[Ajuda] /mute
#7

pawn Код:
enum Player
{
    bool:Muted = false,
    MutedTime
}
new PlayerInfo[MAX_PLAYERS][Player];

//onplayerconnect

// [ SE O PLAYER ESTБ MUDO ] :
if(DOF2_GetInt(Contas(playerid),"Muted") == 1)
{
    if(PlayerInfo[playerid][MutedTime] >= 1)
    {
        SendClientMessage(playerid,cor_vermelho,"Vocк ainda estб mutado!");
        PlayerInfo[playerid][Muted] = true;
        SetTimerEx("DesmutarPlayer",PlayerInfo[playerid][MutedTime]*1000*60,0,"d",playerid);
    }
}

//onplayertext

if(PlayerInfo[playerid][Muted] == true)
    {
        SendClientMessage(playerid,cor_vermelho,"Vocк ainda estб mutado, aguarde atй ser desmutado.");
        return 0;
    }

// Comandos

CMD:mute(playerid,params[])
{
    if(PlayerInfo[playerid][Admin] < 2)
        return SendClientMessage(playerid,cor_vermelho,"Vocк nгo tem permissгo para isso.");
    if(sscanf(params,"uds[128]", params[0], params[1], params[2]))
        return SendClientMessage(playerid,cor_vermelho,"Use: /mute [playerid] [minutos] [motivo]");
    if(!IsPlayerConnected(params[0]))
        return SendClientMessage(playerid,cor_vermelho,"Erro: PlayerID desconectado!");
    new acstr[128];
    format(acstr,sizeof(acstr),"[OpAdmin] Admin '%s' calou vocк por %d minuto(s) motivo: %s",nome(playerid), params[1], params[2]);
    SendClientMessage(params[0], cor_vermelho, acstr);

    SetTimerEx("DesmutarPlayer",60*1000*params[1],false,"i", params[0]);
    PlayerInfo[params[0]][Muted] = true;
    PlayerInfo[params[0]][MutedTime] = params[1];
    PlayerPlaySound(params[0],1057,0.0,0.0,0.0);
    SendClientMessage(playerid, -1, " Mutado");
    return 1;
}

CMD:unmute(playerid,params[])
{
    if(PlayerInfo[playerid][Admin] < 2)
        return SendClientMessage(playerid,cor_vermelho,"Vocк nгo tem permissгo para isso.");
    if(sscanf(params,"d", params[0]))
        return SendClientMessage(playerid,cor_vermelho,"Use: /unmute [playerid]");
    if(!IsPlayerConnected(params[0]))
        return SendClientMessage(playerid,cor_vermelho,"Erro: PlayerID desconectado!");
   
    new acstr[128];
    format(acstr,sizeof(acstr),"[OpAdmin] Admin '%s' descalou vocк", nome(playerid));
    SendClientMessage(params[0],cor_vermelho,acstr);

    DesmutarPlayer(params[0]);
    PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
    return 1;
}



// sotck

forward DesmutarPlayer(playerid);
public DesmutarPlayer(playerid)
{
    PlayerInfo[playerid][Muted] = false;
    PlayerInfo[playerid][MutedTime] = 0;
    SendClientMessage(playerid,cor_vermelho,"Vocк foi desmutado, da proxima vez seja mais atento as regras do servidor!");
    GameTextForPlayer(playerid,"~G~DESMUTADO !",3000,5);
    return 1;
}
Reply


Messages In This Thread
/mute - by s4kuL - 14.02.2014, 19:15
Re: /mute - by s4kuL - 14.02.2014, 19:54
Re: /mute - by PT - 14.02.2014, 20:01
Re: /mute - by s4kuL - 15.02.2014, 12:12
Re: /mute - by PT - 15.02.2014, 12:24
Re: /mute - by s4kuL - 15.02.2014, 12:28
Re: /mute - by PT - 15.02.2014, 12:52
Re: /mute - by s4kuL - 15.02.2014, 13:12
Re: /mute - by ViniBorn - 15.02.2014, 13:25
Re: /mute - by s4kuL - 15.02.2014, 13:38

Forum Jump:


Users browsing this thread: 1 Guest(s)