[Ajuda] Ant-flood
#8

pawn Код:
if(!strcmp(cmd, "/relatorio", true) || !strcmp(cmd, "/relatorio", true))
    {
            if(gPlayerLogged[playerid] == 0)
                return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб logado!");
               
            if(IsPlayerFlooding(playerid, 5)){
                return SendClientMessage(playerid, -1,"SPAMM (5s)");
            }
            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(PlayerInfo[playerid][pVIP] == 1)
            {
                new lol;
                lol = PlayerInfo[playerid][pVIP];
                format(string, sizeof(string), "Relatorio VIP de %s - ID[%d]: %s ", sendername, playerid, lol, (result));
                //HelperBroadCast(COLOR_YELLOW,string,1);
                ABroadCast(COLOR_LIGHTBLUE,string,1);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Seu relatorios VIP foi enviado aos admins..");
            }
            else if(PlayerInfo[playerid][pVIP] == 2)
            {
                new lol;
                lol = PlayerInfo[playerid][pVIP];
                format(string, sizeof(string), "Relatorio VIP-POWER de %s - ID[%d]: %s ", sendername, playerid, lol, (result));
                //HelperBroadCast(COLOR_YELLOW,string,1);
                ABroadCast(COLOR_LIGHTBLUE,string,1);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Seu relatorio VIP-POWER foi enviado aos admins..");
            }
            else
            {
                format(string, sizeof(string), "Relatorio de %s(%d): %s ", sendername, playerid, (result));
                //HelperBroadCast(COLOR_YELLOW,string,1);
                ABroadCast(COLOR_YELLOW,string,1);
                SendClientMessage(playerid, COLOR_YELLOW, "Seu relatorio foi enviado aos admins..");
            }
        }
        return true;

    }

Final:
PHP код:
stock IsPlayerFlooding(ptime){

    static
        
getMessageTime MAX_PLAYERS char ]
    ;
    
    
    if ( 
getMessageTime } != ) {
    
        if ( ( 
gettime() - getMessageTime }  ) < time ){
        
            
getMessageTime } = gettime ( ) ;
            return !
false ;
        }
    }
    
    
getMessageTime } = gettime ( ) ;
    return !
true ;

Reply


Messages In This Thread
Ant-flood - by Kirikage - 25.10.2012, 20:36
Re: Ant-flood - by Don_Speed - 25.10.2012, 22:03
Re: Ant-flood - by Kirikage - 25.10.2012, 22:17
Respuesta: Ant-flood - by Coreia - 25.10.2012, 22:41
Re: Ant-flood - by Jessica_Azeredo - 25.10.2012, 22:56
Re: Ant-flood - by PSYRocK - 26.10.2012, 00:39
Re: Ant-flood - by matheuspain - 26.10.2012, 02:16
Re: Ant-flood - by zSuYaNw - 26.10.2012, 02:54

Forum Jump:


Users browsing this thread: 1 Guest(s)