Textdraw causes crashes
#1

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)