[AJUDA]/Relatorio com Settimer
#6

pega ai:

pawn Код:
//no topo do gm:
new timerrelato[MAX_PLAYERS];
new TempoRelato[MAX_PLAYERS]; // talvez vc tenha uma var com nome TempoRelato, deverб apaga-la e por essa.


//no comando, substitui por esse:
if(strcmp(cmd, "/relatorio", true) == 0 || strcmp(cmd, "/relato", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб logado!");
            if(timerrelato[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "Vocк sу poderб enviar outro relatorio dentro de 8 segundos");
            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)) return SendClientMessage(playerid, COLOR_GRAD2, "USE: /relatorio [texto]");

            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(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...");
                TempoRelato[playerid] = SetTimer("MandouRelato", 7000, false, "i",playerid);
                timerrelato[playerid] = 1;
            }
            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...");
                TempoRelato[playerid] = SetTimerEx("MandouRelato", 8000, false,"i", playerid);
                timerrelato[playerid] = 1;
            }
        }
        return 1;
    }
   

//no final do gm. depois da ultima linha
forward MandouRelato (playerid);
public MandouRelato (playerid)
{
    timerrelato[playerid] = 0;
    KillTimer(TempoRelato[playerid]);
}
@edit, arrumei uma coisinha q tinha esquecido.
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)