Server crashing when flooding in a cmd
#1

Hello guys,im having a problem with commands example when they have variables like on/off...when i type example /name aaaaaaaaaaaaa spam it till the last word the server gets crashed,it also works with the other commands so please do you have any idea of getting rid of this bug? Drop down a reply with the code if you can help me on the OnPlayerCommandPerformed! Thank you

Код:
COMMAND:name(playerid, params[])
{
	if(PlayerInfo[playerid][admin] || PlayerInfo[playerid][premium] || PlayerInfo[playerid][playerteam]==HITMAN || PlayerInfo[playerid][playerteam]==FBI || PlayerInfo[playerid][playerleve]>= 10)
	{
		new tmp[5];
		if(sscanf(params, "s", tmp)) return SCP(playerid, "[on/off]");
		if(strcmp(tmp,"on",true)==0)
		{
			PlayerTemp[playerid][hname]=0;
			GameTextForPlayer(playerid,"~g~ShowName ON",1000,1);
			PlayerLoop(i) ShowPlayerNameTagForPlayer(i,playerid,1);
		}
		else if(strcmp(tmp,"off",true)==0)
		{
			PlayerTemp[playerid][hname]=1;
			GameTextForPlayer(playerid,"~r~ShowName OFF",1000,1);
			PlayerLoop(i) if(!PlayerInfo[i][power]) ShowPlayerNameTagForPlayer(i,playerid,0);
		}
		else return SCP(playerid, "[on/off]");
	}
	else return SendClientError(playerid, CANT_USE_CMD);
	return 1;
}
Reply


Messages In This Thread
Server crashing when flooding in a cmd - by CopKing123 - 12.05.2015, 19:16
Re: Server crashing when flooding in a cmd - by Jefff - 12.05.2015, 19:26
Re: Server crashing when flooding in a cmd - by CopKing123 - 12.05.2015, 19:29
Re: Server crashing when flooding in a cmd - by Threshold - 13.05.2015, 04:21

Forum Jump:


Users browsing this thread: 1 Guest(s)