Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //================================== ANTI CLEO =================================
- enum {
- // Anti DDos Bots
- PLAYER_BOT_LEVEL3,
- PLAYER_BOT_LEVEL2,
- PLAYER_BOT_LEVEL1,
- }
- new connect = -1,
- databaseIP[MAX_PLAYERS][20],
- Float:g_diferencasAngle[MAX_VEHICLES],
- vehVelocity[MAX_VEHICLES];
- new lastcommand[MAX_PLAYERS]; //Command Flood
- #define INVALID_CHAT_BLOCK
- #define SERVER_SIDE_DELAY (0002)
- #define MAX_DISTANCE_DEF (83.1)
- #define pFunction%0(%1) %0(%1); public%0(%1)
- #define varGet(%0) getproperty(0,%0)
- #define varSet(%0,%1) setproperty(0, %0, %1)
- /*--------------------------------------------------
- * Anti DDos Bots
- -------------------------------------------------*/
- if(GetPlayerPing(playerid) != 0xFFFF && GetPlayerPing(playerid) != 0) SetPVarInt(playerid, #jogadorDisponivel, 1);
- if(IsPlayerConnected(playerid) && GetPlayerPing(playerid) == 0xFFFF) {
- static tmpip[20];
- GetPlayerIp(playerid, tmpip, 20);
- if(0x1c5 > (gettime() - varGet(tmpip))) {
- tmpip[(strlen(tmpip) - 1)] = 'x';
- if(varGet(tmpip) > 3) {
- return CallLocalFunction("OnPlayerHacking", "ii", playerid, PLAYER_BOT_LEVEL3);
- }
- CallLocalFunction("OnPlayerHacking", "ii", playerid, PLAYER_BOT_LEVEL2);
- }
- CallLocalFunction("OnPlayerHacking", "ii", playerid, PLAYER_BOT_LEVEL1);
- SetTimerEx("registerBot_pB", 700, false, #i , playerid);
- }
- return false;
- }
- pFunction registrarJogador_pB(playerid) {
- static tmpip[20];
- g_diferencasAngle[playerid] = 0;
- GetPlayerIp(playerid, tmpip, 20);
- varSet(tmpip, gettime()); ++connect;
- if(connect == MAX_PLAYERS - 1) {
- for(connect = 0; databaseIP[connect][0]; connect++) continue;
- }
- SetTimerEx("resetBot_pB", 50000, false, "i", connect);
- tmpip[strlen(tmpip)-1] = 'x';
- format(databaseIP[connect], 20, tmpip);
- varSet(tmpip, varGet(tmpip) +1);
- SetPVarInt(playerid, #tPosSet, gettime());
- return SetTimerEx("registerBot_pB", 700, false, #i , playerid);
- }
- pFunction resetBot_pB(botid) {
- varSet(databaseIP[botid], 0);
- return databaseIP[botid][0] = EOS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement