View Single Post
Old 13/10/2012, 06:56 PM   #4
ReVo_
Gangsta
 
ReVo_'s Avatar
 
Join Date: Oct 2009
Posts: 537
Reputation: 73
Default Re: /mute /unmute Cmd

pawn Code:
new bool:Muted[MAX_PLAYERS];

pawn Code:
COMMAND:mute(playerid, params[])
{
if (!IsPlayerAdmin(playerid)) return 1; // player is not admin
new id = strval(params);
if (!IsPlayerConnected(id)) return 1; // invalid player
if (Muted[id]) return 1; // already muted
Muted[id]=true;
}

COMMAND:unmute(playerid, params[])
{
if (!IsPlayerAdmin(playerid)) return 1; // player is not admin
new id = strval(params);
if (!IsPlayerConnected(id)) return 1; // invalid player id
if (!Muted[id]) return 1; // player not muted
Muted[id]=false;
}

OnPlayerText:


pawn Code:
if (Muted[playerid])
return SendClientMessage(playerid,-1,"You are muted."), 0;

OnPlayerConnect:
pawn Code:
Muted[playerid]=false;
ReVo_ is offline   Reply With Quote