spree system take from warcheif
and
enum pInfo
{
Muted
}
public OnPlayerDisconnect( playerid, reason )
{
PlayerInfo[playerid][Muted] = 0;
return 1;
}
if(strcmp(cmd,"mute",true) == 0)
{
if(!IsAuthorized(playerid,"bring")) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
{
new plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c mute [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
if(PlayerInfo[plr][Muted] == 0)
{
PlayerInfo[plr][Muted] = 1;
new str[256];
format(str,sizeof(str),"ADMIN %s Muted %s for a long time...",gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll(COLOR_WHITE,str);
SendClientMessage(plr,COLOR_RED,"Stop talking or you will be kicked...");
}
else
{
SendClientMessage(playerid,COLOR_RED,"You cannot mute him 2 times..");
}
}
}
return 1;
}
else if(strcmp(cmd,"unmute",true) == 0)
{
if(!IsAuthorized(playerid,"bring")) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
{
new plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c mute [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
if(PlayerInfo[plr][Muted] == 1)
{
PlayerInfo[plr][Muted] = 0;
new str[256];
format(str,sizeof(str),"ADMIN %s unmuted %s...",gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll(COLOR_WHITE,str);
SendClientMessage(plr,COLOR_RED,"You are free to talk...");
}
else
{
SendClientMessage(playerid,COLOR_RED,"You cannot unmute him without being muted..");
}
}
}
return 1;
}
Onplayertext
if(PlayerInfo[playerid][Muted] == 1)
{
new str[256];
format(str,sizeof(str),"%s was been kicked for revealing the bannana from his mouth..",gPlayers[playerid]);
SendClientMessageToAll(COLOR_WHITE,str);
Kick(playerid);
return 0;
}