04.05.2014, 15:12
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;
}