SA-MP Forums Archive
Server crashing - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server crashing (/showthread.php?tid=511226)



Server crashing - TheSimpleGuy - 04.05.2014

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?


Re: Server crashing - PrivatioBoni - 04.05.2014

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


Re: Server crashing - TheSimpleGuy - 04.05.2014

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