why wont my command work?
#1

Ok, I have an unmute command (using sscanf) that crashes the server when i use it. If I just type '/unmute', then it shows the 'USAGE:' line, but if i type' /unmute 2' for example, then server crashes :/

Код:
COMMAND:unmute(playerid, params[])
{
	if(PlayerInfo[playerid][Admin] > 0)
	{
		new targetid, string[128];
		if(sscanf(params, "u", targetid)) SendUsage(playerid, "USAGE: /unmute [targetid]");
		else
		{
	        if(IsPlayerConnected(targetid))
	        {
				format(string, 128, "**(ADMIN UNMUTE)** %s(%d) has been unmuted by Admin '%s(%d)'", PlayerName(targetid), targetid);
				SendClientMessageToAll(COLOR_RED, string);
				PlayerInfo[targetid][Muted] = 0;
	        }
	        else
	        {
	            SendClientMessage(playerid, COLOR_WHITE, "ERROR: That player is not connected.");
	        }
		}
	}
	else SendErrorMessage(playerid);
	return 1;
}
Reply


Messages In This Thread
why wont my command work? - by Raz0r1000 - 28.01.2011, 22:37
****** - by Mean - 28.01.2011, 23:11
Re: why wont my command work? - by Raz0r1000 - 29.01.2011, 18:20

Forum Jump:


Users browsing this thread: 2 Guest(s)