Server crashing command
#1

Hello, i have a problem with this command.
When i change the name of one of the divisions with this command, it has a random chance of crashing the server, which it most likely does.

Код HTML:
CMD:adjustdivisionname(playerid, params[])
{
	new division, name[8], string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsACop(playerid) || !PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD leader.");
	if(sscanf(params, "is[32]", division, name)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /adjustdivisionname [division 1-5] [name]");
	switch(division)
	{
	    case 1:
	    {
	        FacInfo[1][fDiv1] = name;
	        format(string, sizeof(string), "You have set division 1's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 2:
	    {
	        FacInfo[1][fDiv2] = name;
	        format(string, sizeof(string), "You have set division 2's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 3:
	    {
	        FacInfo[1][fDiv3] = name;
	        format(string, sizeof(string), "You have set division 3's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 4:
	    {
	        FacInfo[1][fDiv4] = name;
	        format(string, sizeof(string), "You have set division 4's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 5:
	    {
	        FacInfo[1][fDiv5] = name;
	        format(string, sizeof(string), "You have set division 5's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	}
	return 1;
}
Reply


Messages In This Thread
Server crashing command - by CalvinC - 24.11.2014, 05:38
Re : Server crashing command - by Dutheil - 24.11.2014, 11:14
Re: Server crashing command - by CalvinC - 24.11.2014, 15:20
Re: Server crashing command - by CalvinC - 25.11.2014, 10:45
Re: Server crashing command - by CalvinC - 26.11.2014, 07:39
Re: Server crashing command - by dusk - 26.11.2014, 07:47
Re: Server crashing command - by CalvinC - 26.11.2014, 09:43
Re: Server crashing command - by dusk - 26.11.2014, 10:20
Re: Server crashing command - by CalvinC - 26.11.2014, 10:43
Re: Server crashing command - by CalvinC - 10.12.2014, 08:29

Forum Jump:


Users browsing this thread: 1 Guest(s)