[AJUDA]/Relatorio com Settimer
#1

Alguem pode ajudar? eu tentei fazer + n deu mt certo entao deixei desligado, eu queria q o settimer fosse por id, tipo tal player mando relato ae so depois de 8 segundos ele pode manda denovo + quem nao mando relato pode manda entendeu? tipo nao kero q tenha apenas um relato a cada 8 segundos + q cada player so mande 1 a cada 8 segundos igual alguns gms de rpg +conhecidos bpg bpf e etc

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(pMandoRelato[playerid] == 1)
            {
                SendClientMessage(playerid,COLOR_GRAD2,"Espere 8 segundos para poder mandar o relatorio novamente!");
                return 1;
            }*/

            if(PlayerInfo[playerid][pVIP] == 1)
            {
                new lol;
                lol = PlayerInfo[playerid][pVIP];
                format(string, sizeof(string), "==> Relatуrio VIP 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...");
                //pMandoRelato[playerid] = 1;
                TempoRelato = SetTimer("MandoRelato", 7000, 0);
            }
            else
            {
                format(string, sizeof(string), "==> Relatуrio de %s(%d): %s <==", sendername, playerid, (result));
                ABroadCast(0xFFFF66FF,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio foi enviado aos admins, aguarde uma resposta...");
                //pMandoRelato[playerid] = 1;
                TempoRelato = SetTimer("MandoRelato", 8000, 0);
            }
        }
        return 1;
    }
Reply


Messages In This Thread
[AJUDA]/Relatorio com Settimer - by Luiiz - 11.04.2012, 20:17
Re: [AJUDA]/Relatorio com Settimer - by CidadeNovaRP - 11.04.2012, 20:25
Re: [AJUDA]/Relatorio com Settimer - by Luiiz - 11.04.2012, 20:34
Re: [AJUDA]/Relatorio com Settimer - by CidadeNovaRP - 11.04.2012, 20:42
Re: [AJUDA]/Relatorio com Settimer - by Luiiz - 11.04.2012, 20:49
Re: [AJUDA]/Relatorio com Settimer - by steeldark - 11.04.2012, 21:02
Re: [AJUDA]/Relatorio com Settimer - by CidadeNovaRP - 11.04.2012, 21:14
Re: [AJUDA]/Relatorio com Settimer - by Ricop522 - 11.04.2012, 21:53

Forum Jump:


Users browsing this thread: 1 Guest(s)