[Pedido] Anti DDos Flood-Bot
#6

Quote:
Originally Posted by billy the kid
Посмотреть сообщение
cara nao e tirando vc mais vvc ja fez 4 ou mais POST SOBRE O MESMO ASSUNTO!
Й que nem um deles foram resolvidos...
E й super urgente

pawn Код:
#include a_samp

#if !defined varGet
#define varGet(%0)      getproperty(0,%0)
#endif

#if !defined varSet
#define varSet(%0,%1) setproperty(0, %0, %1)
#endif

#define IsPlayerBot(%0)\
            GetPlayerPing(%0) == 65535 && (gettime() - varGet((GetPlayerIp(%0, botGetIP, sizeof botGetIP), botGetIP)) > 5)


public OnPlayerConnect(playerid) {

    if(IsPlayerNPC(playerid)) return false;

    static
        playerip[24]
    ;

    GetPlayerIp(playerid, playerip, 24);

    if(gettime() - varGet(playerip) < 2) {


        strcat(playerip, "di_S");

        if(gettime() - varGet(playerip) < 3) {
            return false;
        }

        printf("%d Entrou em menos de 2 segundos", playerid);

        GetPlayerIp(playerid, playerip, 20);

        varSet(playerip, gettime());

        strcat(playerip, "x");

        static timers ;
        timers = varGet(playerip);

        varSet(playerip, 1+ timers);

        if(timers > 2) {

            playerip[strlen(playerip) - 2] = 0;

            printf("BOT: ID -> %d IP -> %s", playerid, playerip);
            BanEx(playerid, "Bot Connect");
        }
    }
    if(IsPlayerNPC(playerid)) return false;
    return varSet(playerip, gettime());
}


public OnPlayerDisconnect(playerid, reason) {
    if(reason == 2) {

        static
            playerip[20]
        ;


        GetPlayerIp(playerid, playerip, 20);
        strcat(playerip, "di_S");

        varSet(playerip, gettime());
    }
    if(IsPlayerNPC(playerid)) return false;
    return false;

}
Eu tou usando em FS assim, sу que nem ta funfando..
Reply


Messages In This Thread
Anti DDos Flood-Bot - by Mercurio - 23.07.2012, 03:31
Re: Anti DDos Flood-Bot - by Kasura - 23.07.2012, 03:35
AW: Anti DDos Flood-Bot - by billy the kid - 23.07.2012, 03:35
Respuesta: Anti DDos Flood-Bot - by ipsBruno - 23.07.2012, 03:37
Re: Anti DDos Flood-Bot - by Mercurio - 23.07.2012, 03:44
Re: AW: Anti DDos Flood-Bot - by Mercurio - 23.07.2012, 03:58
Re: AW: Anti DDos Flood-Bot - by Smoking_Script - 02.09.2013, 01:17
Re: AW: Anti DDos Flood-Bot - by SkullFire - 02.09.2013, 14:58
Re: Anti DDos Flood-Bot - by neymar1477 - 17.05.2014, 18:07
Respuesta: Anti DDos Flood-Bot - by Parka - 17.05.2014, 19:09

Forum Jump:


Users browsing this thread: 1 Guest(s)