Server crashing
#1

pawn Код:
CMD:mute(playerid, params[])
{
    new id, reason, name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[256];
    if(PlayerInfo[playerid][pAdmin] >= 4) {
    if(sscanf(params,"ds",id,reason)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /mute [id] [reason]");
    if(id==playerid) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot mute yourself!");
    if(id==INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player is not connected!");
    GetPlayerName(playerid, name1, sizeof(name1));
    GetPlayerName(id, name2, sizeof(name2));
    format(string, sizeof(string), "%s [%d] has muted %s [%d]. Reason: %s",name1,playerid,name2,id,reason);
    SendClientMessageToAll(0xFF0000FF, string);
    Mute[id] = 1;
    } else SendClientMessage(playerid, 0xFF0000FF, "ERROR: You do not have the privilege to access this command!");
    return 1;
}
Server is crashing after I use the command. What is wrong?
Reply
#2

pawn Код:
new reason[64];
if(sscanf(params,"ds[64]",id,reason))
See what happens.
Reply
#3

Oh shit, I forgot to add the reason value. Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)