28.01.2011, 22:37
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; }