mute cmd help
#1

If i mute anyone It should send him error but it still make him talk.
pawn Код:
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 );
}
Reply
#2

pawn Код:
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;
}
there are, see if it works there?

and by the way as you defined it? o.O

pawn Код:
LevelCheck(playerid, 1);
Reply
#3

Quote:
Originally Posted by !R1Ch@rD!
Посмотреть сообщение
pawn Код:
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;
}
there are, see if it works there?

and by the way as you defined it? o.O

pawn Код:
LevelCheck(playerid, 1);
yes.
Reply
#4

Quote:
Originally Posted by Kinglee
Посмотреть сообщение
yes.
did that work??
Reply
#5

Quote:
Originally Posted by !R1Ch@rD!
Посмотреть сообщение
did that work??
nope players can talk
Reply
#6

Quote:
Originally Posted by Kinglee
Посмотреть сообщение
nope players can talk
you have defined in OnPlayerText Muted?

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;
    }
This is something you make him an example and as you can !!
Reply
#7

I have this on onplayertext.
pawn Код:
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 );
    }
Reply
#8

pawn Код:
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;
}
I see all good friend, not because the player speaks

can you tell me as you defined it?

pawn Код:
PlayerInfo[Player][PMutes]++;
if not delete it

and because you put return (0);?
Reply
#9

still not working
Reply
#10

pawn Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)