SA-MP Forums Archive
Server Crash When 'TextDrawShowForPlayer' calls - 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: Server Crash When 'TextDrawShowForPlayer' calls (/showthread.php?tid=162514)



Server Crash When 'TextDrawShowForPlayer' calls - Nonameman - 23.07.2010

Hey Guys!

It's me again, I have a rules textdraw, and when I wanna show it for a player, the server crashes.

Here it is:
pawn Код:
new Text:rules;
pawn Код:
OnGameModeInit()
{
rules = TextDrawCreate(320.0, 100.0, "~n~~b~***~g~Szab~lyzat~b~***~n~~n~~b~1. ~r~Ne~w~ cheatelj/hackelj!~n~~b~2. ~r~Ne~w~ spam-eld a chat-et!~n~~b~3. ~r~Ne~w~ kћrj admin jogot!~n~~b~4. ~r~Ne~w~ Ёlj meg senkit ha nem vagy PvP!~n~~b~5. ~r~Ne~w~ k~romkodj, ~r~ne~w~ sz˘dd a szervert/az adminokat!~n~~n~~p~Az ablak bez~r~s~hoz nyomd meg a ~w~'~r~BAL EGћRGOMBOT~w~'~p~.~n~");
TextDrawLetterSize(rules, 0.3, 1.0);
TextDrawAlignment(rules, 2);
return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(rules, 5, cmdtext);
return 0;
}
pawn Код:
dcmd_rules(playerid, params[])
{
#pragma unused params
TextDrawShowForPlayer(playerid, rules);
return 1;
}
What could be the problem?


Nonameman


Re: Server Crash When 'TextDrawShowForPlayer' calls - FUNExtreme - 23.07.2010

Don't you get any errors?

I think that it is just to long


Re: Server Crash When 'TextDrawShowForPlayer' calls - Nonameman - 23.07.2010

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
Don't you get any errors?

I think that it is just to long
Sometimes my computer freezes because of this, or just got an error message and SAMP exits.

I think in the 0.3 there could be 1000+ characters in 1 textdraw.


Re: Server Crash When 'TextDrawShowForPlayer' calls - FUNExtreme - 23.07.2010

Oh, I just saw that you defined rules as an int, you need a string!

pawn Код:
Text:rules[sizeoftextdraw];



Re: Server Crash When 'TextDrawShowForPlayer' calls - Nonameman - 23.07.2010

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
Oh, I just saw that you defined rules as an int, you need a string!

pawn Код:
Text:rules[sizeoftextdraw];
If I do this, I got a lot of errors.


Re: Server Crash When 'TextDrawShowForPlayer' calls - FUNExtreme - 23.07.2010

Nevermind, I looked fast and said something that ain't right. Your code is correct, but I'm still supporting my "to long" reply


Re: Server Crash When 'TextDrawShowForPlayer' calls - Nonameman - 23.07.2010

Okey, thank, I'll try it.


Re: Server Crash When 'TextDrawShowForPlayer' calls - kLx - 24.07.2010

Many colors in textdraws causes crashes in 0.3


Re: Server Crash When 'TextDrawShowForPlayer' calls - aNdReSk - 24.07.2010

klx what u mean by many colors?