Server Crash When 'TextDrawShowForPlayer' calls
#1

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

Don't you get any errors?

I think that it is just to long
Reply
#3

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

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

pawn Код:
Text:rules[sizeoftextdraw];
Reply
#5

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

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

Okey, thank, I'll try it.
Reply
#8

Many colors in textdraws causes crashes in 0.3
Reply
#9

klx what u mean by many colors?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)