OnPlayerCommandText
else if(strcmp(cmd,"mute",true) == 0)
{
new plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "-> Please login!." );
{
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else if ( !IsAuthorized( playerid, "mute" ) ) SendClientMessage( playerid, COLOR_RED, "-> Not have access to the command! :P!" );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: /c mute [Nick/ID]" );
else {
if(PlayerInfo[plr][Muted] == 0)
{
PlayerInfo[plr][Muted] = 1;
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;
}
OnPlayerText
if(PlayerInfo[playerid][Muted] == 1)
{
new str[256];
format(str,sizeof(str),"Auto-Kick Player:[ %s ] Reason:[ Mute Evader ]",gPlayers[playerid]);
SendClientMessageToAll(COLOR_Yellow,str);
Kick(playerid);
return 0;
}
On TOP!
enum pInfo
{
Password[ MAX_PASS_SIZE +1 ],
Logged,
Level,
Skinid,
Stats,
Muted