SA-MP Forums Archive
/stats Command = Server Crash - 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)
+--- Thread: /stats Command = Server Crash (/showthread.php?tid=474537)



/stats Command = Server Crash - Blackazur - 08.11.2013

Hello, why my server crash when i type this command?

Код:
CMD:stats(playerid,params[])
{
	new str[300];
	format(str,sizeof(str),"Megtekintйse Statisztika: %s","Viewing Stats from: %s",GetName(playerid));
	SendClientMessage(playerid,COLOR_GREEN,str);
	format(str,sizeof(str),"[Pontszбm: %s] [Pйnz: %d] [H-Цl: %d] [Z-Цl: %d] [Admin Szint: %d]","[Score: %s] [Money: %d] [H-Kills: %d] [Z-Kills: %d] [Admin Level: %d]",GetPlayerScore(playerid),GetPlayerMoney(playerid),Kills[playerid][EMBER],Kills[playerid][ZOMBI],GetPVarInt(playerid,"adminlevel"));
	SendClientMessage(playerid,COLOR_ORANGE,str);
	return 1;
}



Re: /stats Command = Server Crash - Elie1996 - 08.11.2013

SendClientMessage can only handle so may characters.
If this message is long it will be whiped out and only the first 144 characters will be shown.

And, make sure there aren't any warnings in your script.
And make sure you have it under OnPlayerCommandText.


Re: /stats Command = Server Crash - Konstantinos - 08.11.2013

Like Elie1996 said, client message can only display 144 characters, so change the size of str to 144 and try again. If it still crashes the server, then load crashdetect plugin and go in-game, type the command and if it crashes, then post the results.