SA-MP Forums Archive
Textdraw causes crashes - 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 causes crashes (/showthread.php?tid=246656)



Textdraw causes crashes - Feverlander - 05.04.2011

Hello.
I'm scripting some advanced function with the use of textdraws, but it causes some crashes. Look at the code (of course it's changed a bit, I don't want to publish my whole work).
Код:
new str[1024];
for(new p = 1; p < 11; p++)
{
	new i = Occupied(playerid, p); // Returns ID of some thing.
	if(i)
		format(str, sizeof(str), "%s~n~~y~~h~%d - Raawr~n~", str, p);
	else
		format(str, sizeof(str), "%s~n~", str);
}
TextDrawSetString(TD[playerid], str);
TextDrawShowForPlayer(playerid, TD[playerid]);
When I use command with submitted code, it causes a crash and kicks me. Strange though, when I change loop to call for 9 times (for new p = 1; p < 10; p++), it... works. Anyone knows how to solve this problem?
BTW. sorry for my English, if something is hard to understand, please let me know.


Re: Textdraw causes crashes - Gamer_Z - 05.04.2011

Already discussed:
https://sampforum.blast.hk/showthread.php?tid=162529

Quote:
Originally Posted by RyDeR
Had the same problem. It's just strange.
I figured out that :
- When you use more then 256 chars with colors you will crash.
- When you use more then 256 chars without colors it %100 works.

Simple solution:
Just use 256+ chars without colors.



Re: Textdraw causes crashes - Feverlander - 05.04.2011

Daamn, I was worrying it's all about colors... Is there any way to bypass it? I really need them.


Re: Textdraw causes crashes - Gamer_Z - 05.04.2011

I didn't find yet a way except to make more than 1 textdraw...


Re: Textdraw causes crashes - Feverlander - 05.04.2011

Okay, thank you (właściwie to dzięki :P).