CMD:mute( playerid, params[ ] )
{
LevelCheck( playerid, 1 );
new
Player,
Reason[ 80 ],
mutetime
;
if ( sscanf( params, "uis[100]", 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;
}
if ( PlayerInfo[ Player ][ Muted ] == mutetime )
return SendError( playerid, "Player is already muted" );
CMDMessageToAdmins( playerid, "mute" );
PlayerInfo[ playerid ][ PMutes ]++;
PlayerPlaySound( Player, 1057, 0.0, 0.0, 0.0 );
PlayerInfo[ Player ][ Muted ] = mutetime;
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 );
}
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;
}
LevelCheck(playerid, 1);
pawn Код:
and by the way as you defined it? o.O pawn Код:
|
if(PlayerInfo[playerid][Muted] == 1)
{
PlayerInfo[playerid][MuteWarnings]++;
new string[128];
if(PlayerInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) {
format(string, sizeof(string),"** You are muted, if you keep talking you shall be kicked. [%d/%d]", PlayerInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] );
SendClientMessage(playerid,red,string);
} else {
format(string, sizeof(string),"*** %s [%d] as been muted Kicked for exceeding!", pName(playerid), playerid);
SendClientMessageToAll(red,string);
SaveToFile("KickLog",string);
SetTimerEx("DarKick", 300,0,"d",playerid);
} return 0;
}
if ( PlayerInfo[ playerid ][ Muted ] == 1 )
{
PlayerInfo[ playerid ][ MuteWarnings ]++;
if ( PlayerInfo[ playerid ][ MuteWarnings ] < 5 )
FormatMSG( playerid, COLOR_ULTRARED, "You are muted, if you continue to speak you will be kicked. ({33CCFF}%d{FF0000}/5)", PlayerInfo[ playerid ][ MuteWarnings ] );
else
{
SendClientMessage( playerid, COLOR_ULTRARED, "You have been warned! Now you have been kicked" );
FormatLog( "KickLog", "*** %s(%d) have been auto-kicked. Reason: Exceding max mute warnings !", PlayerName( playerid ), playerid );
Kick( playerid );
}
return ( 0 );
}
if(PlayerInfo[playerid][Muted] == 1)
{
PlayerInfo[playerid][MuteWarnings]++;
if(PlayerInfo[playerid][MuteWarnings] < 5)
FormatMSG(playerid,COLOR_ULTRARED, "You are muted, if you continue to speak you will be kicked. ({33CCFF}%d{FF0000}/5)", PlayerInfo[playerid][MuteWarnings]);
else {
SendClientMessage(playerid,COLOR_ULTRARED, "You have been warned! Now you have been kicked" );
FormatLog("KickLog", "*** %s(%d) have been auto-kicked. Reason: Exceding max mute warnings !", PlayerName( playerid ), playerid );
Kick(playerid);
} return 0;
}
PlayerInfo[Player][PMutes]++;
public OnPlayerText(playerid, text[])
{
if ( PlayerInfo[ playerid ][ Muted ] == 1 )
{
FormatMSG( playerid, COLOR_ULTRARED, "You are muted, if you continue to speak you will be kicked. ({33CCFF}%d{FF0000}/5)", PlayerInfo[ playerid ][ MuteWarnings ] );
PlayerInfo[ playerid ][ MuteWarnings ]++;
return 0;
}
if ( PlayerInfo[ playerid ][ MuteWarnings ] > 5 ) // If you players got warned
{
SendClientMessage( playerid, COLOR_ULTRARED, "You have been warned! Now you have been kicked" );
FormatLog( "KickLog", "*** %s(%d) have been auto-kicked. Reason: Exceding max mute warnings !", PlayerName( playerid ), playerid );
Kick( playerid );
return 0;
}
return 1;
}