[Ajuda] Anti Flood de comandos
#7

Mande as linhas

bom vo mandar um comando com esse tipo de funзгo hihihih

Adapte Mais Ou Menos Assim

pawn Код:
if(strcmp(cmd, "/relatorio", true) == 0 || strcmp(cmd, "/relato", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб logado!");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /relatorio [texto]");
                return 1;
            }
            if(TentouDivulgar(result))
            {
                if(cdivulgar[playerid] >= 6)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Aqui vocк nгo pode anunciar servidores!");
                    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Cuidado, Poderб ser banido.");
                    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Evite digitar muitos nъmeros consecutivos.");
                    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
                    Kick(playerid);
                }
                GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
                format(string, 128, "AdmAviso: [%d]%s tentou divulgar: %s.",playerid,playername,result);
                ABroadCast(COLOR_YELLOW,string,1);
                DivulgouLog(string);
                cdivulgar[playerid] += 1;
                return 1;
            }
            if(GetTickCount() - TempoComando[playerid] < 10000)
            {
                 SendClientMessage(playerid,COR_HITMAN,"Voce tem que esperar um pouco para enviar outro Relatorio!");
                 return 1;
            }
            if(PlayerInfo[playerid][pJailed] != 0)
            {
                SendClientMessage(playerid,0x9E50FFAA," Vocк nгo pode usar esse comando na cadeia!");
                return 1;
            }
            if(PlayerInfo[playerid][pVIP] == 1)
            {
                new lol;
                lol = PlayerInfo[playerid][pVIP];
                format(string, sizeof(string), "{9C9C9C}==> Relatуrio Vip-Prata de %s - ID[%d]: %s <==", sendername, playerid, lol, (result));
                ABroadCast(COR_PRATA,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio VIP foi enviado aos admins, aguarde uma resposta...");
                TempoComando[playerid] = GetTickCount();
            }
            else if(PlayerInfo[playerid][pVIP] == 2)
            {
                new lol;
                lol = PlayerInfo[playerid][pVIP];
                format(string, sizeof(string), "{FFC125}==> Relatуrio Vip-Ouro de %s - ID[%d]: %s <==", sendername, playerid, lol, (result));
                ABroadCast(COR_OURO,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio VIP foi enviado aos admins, aguarde uma resposta...");
                TempoComando[playerid] = GetTickCount();
            }
            else if(PlayerInfo[playerid][pVIP] == 3)
            {
                new lol;
                lol = PlayerInfo[playerid][pVIP];
                format(string, sizeof(string), "{00FFFF}==> Relatуrio Socio de %s - ID[%d]: %s <==", sendername, playerid, lol, (result));
                ABroadCast(0xFFFF50AA,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio VIP Socio foi enviado aos admins, aguarde uma resposta...");
                TempoComando[playerid] = GetTickCount();
            }
            {
                format(string, sizeof(string), "{FFD700}==> Relatуrio de %s(%d): %s <==", sendername, playerid, (result));
                ABroadCast(COR_VAGOS,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio foi enviado aos admins, aguarde uma resposta...");
                Temporelato[playerid] = GetTickCount();
            }
        }
        return 1;
    }
Assim Como й no /relato os relatos vips adiciona igual ta ai blz??
Reply


Messages In This Thread
Anti Flood de comandos - by [CGU]iSlin_Shady - 14.01.2013, 20:30
Re: Anti Flood de comandos - by Wellington1999 - 14.01.2013, 20:34
Re: Anti Flood de comandos - by [CGU]iSlin_Shady - 14.01.2013, 20:43
Re: Anti Flood de comandos - by [CGU]iSlin_Shady - 14.01.2013, 20:46
Re: Anti Flood de comandos - by Supera - 14.01.2013, 20:50
Re: Anti Flood de comandos - by [CGU]iSlin_Shady - 14.01.2013, 20:50
Respuesta: Anti Flood de comandos - by Wellington1999 - 14.01.2013, 20:53
Re: Anti Flood de comandos - by [CGU]iSlin_Shady - 14.01.2013, 20:54
Re: Anti Flood de comandos - by .FuneraL. - 14.01.2013, 20:56
Re: Anti Flood de comandos - by HardWar - 14.01.2013, 21:33

Forum Jump:


Users browsing this thread: 2 Guest(s)