[AJUDA]Alguns Problemas
#5

Ant-Spawn:

pawn Код:
#define SPAM_PROTECTION 1
#define SPAM_MAX_MSGS 3
#define SPAM_TIMELIMIT 3 // Segundos que o player pode falar :
pawn Код:
public OnPlayerText(playerid)
{
    new string[256];
    format(string,sizeof(string),"[ID:%d]: %s",playerid,text);
    SendPlayerMessageToAll(playerid,string);
    #if SPAM_PROTECTION      
    SpamProtection(playerid);    
    #endif
    return 0;
}

No Final :

pawn Код:
stock SpamProtection(playerid)
{
        new string[64];
        if(gSpamCount[playerid][0] == 0) { gSpamCount[playerid][1] = TimeStamp();
        }
        gSpamCount[playerid][0]++;
        if(TimeStamp() - gSpamCount[playerid][1] > SPAM_TIMELIMIT)
        {
                gSpamCount[playerid][0] = 1;
                gSpamCount[playerid][1] = TimeStamp();
        }
        else if(gSpamCount[playerid][0] == SPAM_MAX_MSGS) {
                format(string,sizeof(string)," %s Foi Kickado (Flood/Spam Proteзгo)",GetName(playerid));
                SendClientMessageToAll(0xC8BEBEAA,string);
                Kick(playerid);
        }
        return 1;
}
stock GetName(playerid)
{
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid,name,sizeof(name));
 
        return name;
}
Reply


Messages In This Thread
[AJUDA]Alguns Problemas - by Pawn - 10.08.2010, 01:23
Re: [AJUDA]Alguns Problemas - by Macintosh - 10.08.2010, 01:30
Re: [AJUDA]Alguns Problemas - by Kasura - 10.08.2010, 01:45
Re: [AJUDA]Alguns Problemas - by BiieL - 10.08.2010, 17:52
Re: [AJUDA]Alguns Problemas - by zSuYaNw - 10.08.2010, 18:13

Forum Jump:


Users browsing this thread: 1 Guest(s)