SA-MP Forums Archive
Textdraw Ingame - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraw Ingame (/showthread.php?tid=275617)



Textdraw Ingame - Urefeu - 10.08.2011

Hello.

I try to make a little FS so I can change my ingame textdraw.

I'm having a small problem.

Here is my code:

/

The problem: this code makes me crash.

As soon as I make / create [matextdraw] already, nothing is displayed, and my serveur.exe closes, so I do crash ...

Do you have a solution? Thank you!


Re: Textdraw Ingame - MadeMan - 10.08.2011

pawn Код:
ActTextDraw++;
Move this to the end of the command.

pawn Код:
TogglePlayerControllable(playerid, 0);
TD = TextDrawCreate(0.0, 0.0, ETextDrawData[ActTextDraw][ETextDrawContent]);
ReloadTextDraw(playerid);
ETextDrawData[ActTextDraw][ETimerID] = SetTimerEx("GetKeys", 20, true, "i", playerid);
ETextDrawData[ActTextDraw][ETimerStatus] = 1;
new str[126];
format(str, 126, "Vous avez crйй la TextDraw n°%d et avez йtй immobilisй. Utilisez /unfreeze pour vous dйsimmobiliser.", ActTextDraw);
SendClientMessage(playerid, INFO, str);
SendClientMessage(playerid, INFO, "Utilisez les fl?ches directionnelles de votre clavier pour la dйplacer.");
ActTextDraw++;
return 1;



Re : Textdraw Ingame - Urefeu - 10.08.2011

The FS is not at all ends, and that's not going to change anything for now. I am looking just to find out why my server crash ...


Re: Textdraw Ingame - MadeMan - 10.08.2011

pawn Код:
TD = TextDrawCreate(0.0, 0.0, ETextDrawData[ActTextDraw][ETextDrawContent]);
This is crashing it.

TextDrawCreate crashes server when string is empty and ETextDrawContent is empty here.


Re : Textdraw Ingame - Urefeu - 10.08.2011

Look at this little bit and tell me why it would be empty ...

Код:
TDcontent = strrest(cmdtext, idx);
				if(!strlen(TDcontent)) return SendClientMessage(playerid, ERROR, "Usage : /creer | /create [Contenu du TextDraw]");
				if(ETextDrawData[ActTextDraw][ETimerStatus] == 0) KillTimer(ETextDrawData[ActTextDraw][ETimerID]);
				ETextDrawData[ActTextDraw][ETextDrawX] = 0.0;
				ETextDrawData[ActTextDraw][ETextDrawY] = 0.0;
				ETextDrawData[ActTextDraw][ETextDrawContent] = TDcontent;



Re: Re : Textdraw Ingame - MadeMan - 10.08.2011

Quote:
Originally Posted by Urefeu
Посмотреть сообщение
Look at this little bit and tell me why it would be empty ...

Код:
TDcontent = strrest(cmdtext, idx);
				if(!strlen(TDcontent)) return SendClientMessage(playerid, ERROR, "Usage : /creer | /create [Contenu du TextDraw]");
				if(ETextDrawData[ActTextDraw][ETimerStatus] == 0) KillTimer(ETextDrawData[ActTextDraw][ETimerID]);
				ETextDrawData[ActTextDraw][ETextDrawX] = 0.0;
				ETextDrawData[ActTextDraw][ETextDrawY] = 0.0;
				ETextDrawData[ActTextDraw][ETextDrawContent] = TDcontent;
pawn Код:
TDcontent = strrest(cmdtext, idx);
...
ETextDrawData[ActTextDraw][ETextDrawContent] = TDcontent; // ActTextDraw is 1
...
ActTextDraw++;
TD = TextDrawCreate(0.0, 0.0, ETextDrawData[ActTextDraw][ETextDrawContent]); // ActTextDraw is 2
Do you see now?


Re : Textdraw Ingame - Urefeu - 10.08.2011

Ah okay, I had not seen, I thought you wanted me to add.

Thank you!