pawn Код:
CMD:mute(playerid, params[])
{
LevelCheck(playerid, 1);
new Player, Reason[80], mutetime;
if(sscanf(params,"uis[126]",Player,mutetime, Reason)) return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/mute [PlayerID] [Seconds] [Reason]" );
if(!IsPlayerConnected(Player) && Player == INVALID_PLAYER_ID) return SendError( playerid, "Player is not connected or is the highest level admin" );
if(PlayerInfo[Player][Level] > PlayerInfo[playerid][Level]) return SendError( playerid, "You cannot use this command on this admin" );
if(PlayerInfo[Player][Muted] == 1) return SendError(playerid, "Player is already muted" );
if(mutetime >= 201)
{
SendClientMessage(playerid,COLOR_ULTRARED,"You can only mute him for 1-200 seconds");
return 1;
}
CMDMessageToAdmins(playerid,"mute");
PlayerInfo[Player][PMutes]++;
PlayerPlaySound(Player, 1057, 0.0, 0.0, 0.0);
PlayerInfo[Player][Muted] = 1;
PlayerInfo[Player][MuteWarnings] = 0;
format(gsString,sizeof(gsString),"Administrator %s(%d) has muted %s(%d) [Reason: %s]", PlayerName(playerid), playerid, PlayerName(Player),Player,Reason);
SendClientMessageToAll(COLOR_ULTRARED,gsString);
FormatMSG( Player, COLOR_ABLUE, "You have been muted by Administrator %s [Reason: %s]", PlayerName(playerid), Reason);
FormatMSG( playerid, COLOR_ABLUE, "You have muted %s [Reason: %s]", PlayerName(Player), Reason);
return 1;
}