[Pedido] /Relatorio com tempo + ou - de 10 segundos
#10

Quote:
Originally Posted by Brazuca[]s
Посмотреть сообщение
No topo do GM:

pawn Код:
new bool: Relatou[MAX_PLAYERS];
forward ResetarTempo(playerid);

No Comando:

pawn Код:
if(strcmp(cmd, "/relatorio", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new bool: Relatou[MAX_PLAYERS];
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб logado!");
                return 1;
            }
            if(Relatou[playerid] == true) return SendClientMessage(playerid, -1, "Vocк sу pode mandar um relatуrio a cada 10 segundos, por favor espere um pouco");
            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] >= 4)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Aqui vocк nгo pode anunciar servidores!");
                    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Seu servidor й uma merda, nгo divulgue-o aqui!");
                    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Seu noob peguei esse IP e vou divulgar nesse server tambйm, uaheuhaeuhaeahe!");
                    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
                    Kick(playerid);
                }
                format(string, 128, "AdmAviso: [%d]%s tentou divulgar: %s.",playerid,PlayerName(playerid),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 <--", PlayerName(playerid), playerid, lol, (result));
                ABroadCast(0x33FF00FF,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio VIP foi enviado aos admins, aguarde uma resposta...");
            }
            else if(PlayerInfo[playerid][pVIP] == 2)
            {
                new lol;
                lol = PlayerInfo[playerid][pVIP];
                format(string, sizeof(string), "--> Relatуrio Premium de %s - ID[%d]: %s -->", PlayerName(playerid), playerid, lol, (result));
                ABroadCast(0x33FF00FF,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio VIP foi enviado aos admins, aguarde uma resposta...");
            }
            else if(PlayerInfo[playerid][pSocio] == 1)
            {
                new lol;
                lol = PlayerInfo[playerid][pSocio];
                format(string, sizeof(string), "--> Relatуrio Sуcio de %s - ID[%d]: %s -->", PlayerName(playerid), playerid, lol, (result));
                ABroadCast(0x33FF00FF,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio VIP foi enviado aos admins, aguarde uma resposta...");
            }
            else
            {
                format(string, sizeof(string), "--> Relatуrio de %s(%d): %s -->", PlayerName(playerid), playerid, (result));
                ABroadCast(0xFFFF66FF,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatуrio foi enviado com sucesso a Administraзгo, Aguarde por uma resposta...");
            }
            Relatou[playerid] = true;
            SetTimerEx("ResetarTempo", 10000, false, "i", playerid);
        }
        return 1;
    }
Final do GM:

pawn Код:
public ResetarTempo(playerid) // A public que criamos lб em cima em "forward ResetarTempo".
{
    Relatou[playerid] = false; // Permite o player a poder mandar um relatуrio novamente
    return 1;
}
Aff velho, o cara jб falou que nгo deu certo, nгo precisa ficar copiando meus post e colar nгo?

Nгo precisa definir a
pawn Код:
new bool:
duas vezes, ou й sу lб la no topo do GM ou em cada comando, puts meu, deixou atй as mesmas frases que eu, ai nгo nй? Vou nem falar mais nada, brincadera!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)