[pawn] else if(strcmp(cmd,"mute",true) == 0)
{
IsPlayerAdmin(playerid);
{
new plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
else 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)
{
IsPlayerAdmin(playerid);
{
new plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c unmute [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;
}[/pawn]
take this
put this in onplayertext
[pawn]public OnPlayerText( playerid, cmdtext[])
{
new cmd[ 128 ], tmp[ 128 ], szMsg[ 128 ];
new idx, newvar, i, Count;
new Float:x, Float:y, Float:z;
cmd = strtok( cmdtext, idx );
if(PlayerInfo[playerid][Muted] == 1)
{
new str[256];
format(str,sizeof(str),"[PaK-BoT]: Player [ %s ] Was Been Kicked From Server. Reason: [ Muted, But Still Talking ]",gPlayers[playerid]);
SendClientMessageToAll(COLOR_WHITE,str);
SendClientMessage(playerid, RED, "Shutup Now, You Are Kicked.");
Kick(playerid);
return 0;
}[/pawn]
[pawn]public OnPlayerDisconnect( playerid, reason )
{
PlayerInfo[playerid][Muted] = 0;[/pawn]
put this in enum pInfo
[pawn]
Muted,[/pawn]
and ok good luck installing this
need help free to ask