/mute and /unmute
#3

pawn Код:
new mute[MAX_PLAYERS];
command(mute, playerid, params[])
{
    new ID;
    if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /mute [id]");
    else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
    else
    {
        if(mute[ID]==0)
        {
            mute[ID]=1;
            SendClientMessage(ID, 0xFF0000AA, "You have been muted.");
        }
        else SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player already muted.");
    }
    return 1;
}
pawn Код:
command(unmute, playerid, params[])
{
    new ID;
    if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /mute [id]");
    else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
    else
    {
        if(mute[ID]==1)
        {
            SendClientMessage(ID, 0xFF0000AA, "You have been unmuted.");
            mute[ID]=0;
        }
        else SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player isn't muted.");      
    }
    return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(mute[playerid]==1)
    {
        SendClientMessage(playerid, 0xC0C0C0FF, "You are muted and cannot talk.");
        return 0;
    }
    return 1;
}
Reply


Messages In This Thread
/mute and /unmute - by mittukuttan - 24.02.2013, 14:46
Re: /mute and /unmute - by jiwan - 24.02.2013, 15:04
Re: /mute and /unmute - by GoldZoroGrab - 24.02.2013, 15:47
Re: /mute and /unmute - by mittukuttan - 25.02.2013, 07:54
Re: /mute and /unmute - by Blaeks - 25.02.2013, 08:43

Forum Jump:


Users browsing this thread: 1 Guest(s)