[Ajuda]Bloquear cmd
#1

Galera, eu consegui fazer o sistema de bloquear todos os comandos na cadeia, mas agora eu quero desbloquer apenas 1 comando, o /horas.

oq usei para bloquear:
pawn Код:
//Topo
new bool:BlockCMD[MAX_PLAYERS];

//Quando vai preso
BlockCMD[playerid] = true;

//Quando sai da prisгo
BlockCMD[playerid] = false;

//public
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(BlockCMD[playerid]) return SendClientMessage(playerid, -1, "Comandos bloqueados!");
    //resto da public
    return 0;
}
Comando que quero que o player possa usar na cadeia (comando q eu quero desbloquear)
pawn Код:
if(strcmp(cmd, "/horas", true) == 0 || strcmp(cmd, "/horas", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid,sendername,256);
            format(string, 256, "%s olhou as horas no seu relogio",sendername);
            ProxDetector(20.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            new mtext[20];
            new year, month,day;
            getdate(year, month, day);
            if(month == 1) { mtext = "Janeiro"; }
            else if(month == 2) { mtext = "Fevereiro"; }
            else if(month == 3) { mtext = "Marзo"; }
            else if(month == 4) { mtext = "Abril"; }
            else if(month == 5) { mtext = "Maio"; }
            else if(month == 6) { mtext = "Junho"; }
            else if(month == 7) { mtext = "Julho"; }
            else if(month == 8) { mtext = "Agosto"; }
            else if(month == 9) { mtext = "Setembro"; }
            else if(month == 10) { mtext = "Outubro"; }
            else if(month == 11) { mtext = "Novembro"; }
            else if(month == 12) { mtext = "Dezembro"; }
            new hour,minuite,second;
            gettime(hour,minuite,second);
            FixHour(hour);
            hour = shifthour;
            if (minuite < 10)
            {
                if (PlayerInfo[playerid][pJailTime] > 0)
                {
                    //format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~tempo de prisљo: %d seg", day, mtext, hour+1, minuite, PlayerInfo[playerid][pJailTime]);
                    format(string, sizeof(string), "Mкs: %s | Dia: %d | Hora: %d:%d | Tempo de prisгo: %d segundos.", mtext, day, hour+1, minuite, PlayerInfo[playerid][pJailTime]);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
                else
                {
                    //format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour+1, minuite);
                    format(string, sizeof(string), "Mкs: %s | Dia: %d | Hora: %d:%d|", mtext, day, hour+1, minuite);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
            }
            else
            {
                if (PlayerInfo[playerid][pJailTime] > 0)
                {
                    //format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~tempo de prisљo: %d seg", day, mtext, hour+1, minuite, PlayerInfo[playerid][pJailTime]);
                    format(string, sizeof(string), "Mкs: %s | Dia: %d | Hora: %d:%d | Tempo de prisгo: %d segundos.", mtext, day, hour+1, minuite, PlayerInfo[playerid][pJailTime]);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
                else
                {
                    //format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour+1, minuite);
                    format(string, sizeof(string), "Mкs: %s | Dia: %d | Hora: %d:%d|", mtext, day, hour+1, minuite);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
            }
        }
        return 1;
    }
vlw ++rep
Reply


Messages In This Thread
[Ajuda]Bloquear cmd - by Felipe_Wesker - 07.04.2012, 14:04
Re: [Ajuda]Bloquear cmd - by KinX - 07.04.2012, 14:09
Re: [Ajuda]Bloquear cmd - by Felipe_Wesker - 07.04.2012, 14:18
Re: [Ajuda]Bloquear cmd - by KinX - 07.04.2012, 14:21
Re: [Ajuda]Bloquear cmd - by Felipe_Wesker - 07.04.2012, 14:22
Re: [Ajuda]Bloquear cmd - by @Riichard - 07.04.2012, 14:40
Re: [Ajuda]Bloquear cmd - by Felipe_Wesker - 07.04.2012, 14:41
Re: [Ajuda]Bloquear cmd - by Jason` - 07.04.2012, 14:58
Re: [Ajuda]Bloquear cmd - by Felipe_Wesker - 07.04.2012, 16:10

Forum Jump:


Users browsing this thread: 1 Guest(s)