Textdraw Ingame
#1

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!
Reply
#2

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;
Reply
#3

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 ...
Reply
#4

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.
Reply
#5

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;
Reply
#6

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?
Reply
#7

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

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)