Jump to content
  • 0

Întrebare legată de TextDraw


Gawitkkk

Question

Problema intalnita (descriere): Nu este o problemă, ci o întrebare. Am creat un nou job (Trucker), cum fac ca după ce aleg licitația să îmi arate ceva de genul (ca în imaginea de jos)?
Ero(area / rile) / warning-(ul / urile): Nu există.
Liniile de cod / sursa / script-ul(obligatoriu): -
Imagini / Video (optional): http://i.imgur.com/FZ5WpMW.jpg
Ati incercat sa rezolvati singur?: Da, prima dată credeam că este un GameTextForPlayer, însă deabea dupaia am realizat faptul că este un TextDraw. 

Link to comment
Share on other sites

Recommended Posts

  • 0

 

forward PublicDistance();
public PublicDistance() {
return 1;
}

La OnPlayerConnected

 

SetTimer("PublicDistance", true, 1000);
Edited by Stark.sys

"Mulţi programatori buni fac programare nu pentru că se aşteaptă să câştige bani sau să fie lăudaţi de public, ci pentru că e amuzant să programezi." - Linus Torvalds

Link to comment
Share on other sites

  • 0

Faci un timer pentru asta (sa il actualizezi) si acolo ca sa faci din metrii in KM imparti metrii la 1000.

 

 

forward PublicDistance();
public PublicDistance() {
return 1;
}

La OnPlayerConnected

 

SetTimer("PublicDistance", true, 1000);

 

Nu ai mai facut odata un astfel de topic? Sau ma insel eu?

 

Deci, am făcut scriptul... uitați cum am făcut 

 

Prima dată, am creat text draw-urile. 

Acestea sunt:

 

Textdraw0 = TextDrawCreate(218.000000, 342.125000, "Drive the truck to the checkpoint.");
TextDrawLetterSize(Textdraw0, 0.348499, 1.582499);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, -1);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 1);
TextDrawBackgroundColor(Textdraw0, 51);
TextDrawFont(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);

 

Textdraw1 = TextDrawCreate(230.000000, 365.750000, "(Ocean Dock's (LS) - 18.3km)"); TextDrawLetterSize(Textdraw1, 0.354498, 1.455625); TextDrawAlignment(Textdraw1, 1); TextDrawColor(Textdraw1, -1); TextDrawSetShadow(Textdraw1, 0); TextDrawSetOutline(Textdraw1, 1); TextDrawBackgroundColor(Textdraw1, 51); TextDrawFont(Textdraw1, 1); TextDrawSetProportional(Textdraw1, 1);

 

După care am făcut dialog-ul, ce va răspunde după ce va fi aleasă ruta.

 

Acesta este:

 

if(listitem == 0)
            {
                new Float: Destination = GetPlayerDistanceFromPoint(playerid, 2793.4968,-2400.4219,13.6323);
                new szMessage[44];
                TextDrawShowForPlayer(playerid, Trucker1[playerid]);
                format(szMessage, sizeof(szMessage), "Ocean Dock's (LS) - %d km",Destination);
                TextDrawShowForPlayer(playerid, szMessage);
            }

 

Dar tot nu știu cum să fac, nu îmi apare text draw-ul cu locația și km.

Edited by Gawitkkk
Link to comment
Share on other sites

  • 0

Trebuie sa folosesti http://wiki.sa-mp.com/wiki/TextDrawSetString pe Textdraw1 nu

TextDrawShowForPlayer(playerid, szMessage);

dupa ce ii dai TextDrawSetString atunci poti sa il afizezi.

Exemplu:

TextDrawSetString(Textdraw1, szMessage);   
TextDrawShowForPlayer(playerid, Textdraw1);

 

Erorile:

D:\Scripting\Server\gamemodes\excessrp.pwn(39140) : error 001: expected token: ";", but found "new"
D:\Scripting\Server\gamemodes\excessrp.pwn(39141) : error 035: argument type mismatch (argument 1)
D:\Scripting\Server\gamemodes\excessrp.pwn(39141) : error 035: argument type mismatch (argument 1)
D:\Scripting\Server\gamemodes\excessrp.pwn(39143) : error 035: argument type mismatch (argument 2)
D:\Scripting\Server\gamemodes\excessrp.pwn(39140) : warning 203: symbol is never used: "stringtext"
D:\Scripting\Server\gamemodes\excessrp.pwn(39140 -- 39146) : warning 217: loose indentation
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase

4 Errors.
  La liniile:
if(listitem == 0)
            {
                //
                 new Float: distance = GetPlayerDistanceFromPoint(playerid, 2793.4968,-2400.4219,13.6323)
                new stringtext;
                format(stringtext, sizeof(stringtext), "Ocean Dock's - %0.2f km", distance);
                TextDrawShowForPlayer(playerid, Trucker1[playerid]);
                TextDrawSetString(Textdraw2, stringtext);
                TextDrawShowForPlayer(playerid, Textdraw2);
            }
Link to comment
Share on other sites

  • 0

 

new stringtext[200];

 

Nu îmi afișează textdraw-ul cu locația și km.

Poza: http://i.imgur.com/mfEoFrO.png

 

Uite aici scriptul:

if(listitem == 0)
            {
                 new Float: distance = GetPlayerDistanceFromPoint(playerid, 2793.4968,-2400.4219,13.6323);
                new stringtext[400];
                format(stringtext, sizeof(stringtext), "Ocean Dock's - %0.2f km", distance);
                TextDrawShowForPlayer(playerid, Trucker1[playerid]);
                TextDrawSetString(Textdraw2, stringtext);
                TextDrawShowForPlayer(playerid, Textdraw2);
            }

 

Textdraw 1 = Drive the truck to the checkpoint

Textdraw 2 = Locația + km.

Link to comment
Share on other sites

  • 0
            if(listitem == 0)
            {
                new Float: distance = GetPlayerDistanceFromPoint(playerid, 2793.4968,-2400.4219,13.6323);
                new stringtext[400];
                format(stringtext, sizeof(stringtext), "Ocean Dock's - %0.2f km", distance);
                TextDrawShowForPlayer(playerid, Trucker1[playerid]);
                TextDrawShowForPlayer(playerid, Textdraw2);
                TextDrawSetString(Textdraw2, stringtext);
            }

 

242086.png

Link to comment
Share on other sites

  • 0
            if(listitem == 0)
            {
                new Float: distance = GetPlayerDistanceFromPoint(playerid, 2793.4968,-2400.4219,13.6323);
                new stringtext[400];
                format(stringtext, sizeof(stringtext), "Ocean Dock's - %0.2f km", distance);
                TextDrawShowForPlayer(playerid, Trucker1[playerid]);
                TextDrawShowForPlayer(playerid, Textdraw2);
                TextDrawSetString(Textdraw2, stringtext);
            }

 

Tot nu îmi arată locația și distanța rămasă..

Link to comment
Share on other sites

  • 0

Pai da tu acolo vrei sa il si afisezi, cum afisezi daca nu este creat?

Creazal mai intai.

Am creat textdraw-ul și l-am definit. Ar trebui să se afișeze, însă nu se afișează.

 

Scuze dacă te referi la altceva și eu nu am înțeles ce..

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.