Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. //================================== ANTI CLEO =================================
  2. enum {
  3. // Anti DDos Bots
  4. PLAYER_BOT_LEVEL3,
  5. PLAYER_BOT_LEVEL2,
  6. PLAYER_BOT_LEVEL1,
  7. }
  8.  
  9.  
  10. new connect = -1,
  11. databaseIP[MAX_PLAYERS][20],
  12. Float:g_diferencasAngle[MAX_VEHICLES],
  13. vehVelocity[MAX_VEHICLES];
  14. new lastcommand[MAX_PLAYERS]; //Command Flood
  15.  
  16. #define INVALID_CHAT_BLOCK
  17. #define SERVER_SIDE_DELAY (0002)
  18. #define MAX_DISTANCE_DEF (83.1)
  19.  
  20. #define pFunction%0(%1) %0(%1); public%0(%1)
  21. #define varGet(%0) getproperty(0,%0)
  22. #define varSet(%0,%1) setproperty(0, %0, %1)
  23.  
  24. /*--------------------------------------------------
  25. * Anti DDos Bots
  26. -------------------------------------------------*/
  27.  
  28. if(GetPlayerPing(playerid) != 0xFFFF && GetPlayerPing(playerid) != 0) SetPVarInt(playerid, #jogadorDisponivel, 1);
  29. if(IsPlayerConnected(playerid) && GetPlayerPing(playerid) == 0xFFFF) {
  30. static tmpip[20];
  31. GetPlayerIp(playerid, tmpip, 20);
  32. if(0x1c5 > (gettime() - varGet(tmpip))) {
  33. tmpip[(strlen(tmpip) - 1)] = 'x';
  34. if(varGet(tmpip) > 3) {
  35. return CallLocalFunction("OnPlayerHacking", "ii", playerid, PLAYER_BOT_LEVEL3);
  36. }
  37. CallLocalFunction("OnPlayerHacking", "ii", playerid, PLAYER_BOT_LEVEL2);
  38. }
  39. CallLocalFunction("OnPlayerHacking", "ii", playerid, PLAYER_BOT_LEVEL1);
  40. SetTimerEx("registerBot_pB", 700, false, #i , playerid);
  41. }
  42. return false;
  43. }
  44.  
  45. pFunction registrarJogador_pB(playerid) {
  46. static tmpip[20];
  47.  
  48. g_diferencasAngle[playerid] = 0;
  49. GetPlayerIp(playerid, tmpip, 20);
  50. varSet(tmpip, gettime()); ++connect;
  51.  
  52. if(connect == MAX_PLAYERS - 1) {
  53. for(connect = 0; databaseIP[connect][0]; connect++) continue;
  54. }
  55. SetTimerEx("resetBot_pB", 50000, false, "i", connect);
  56.  
  57. tmpip[strlen(tmpip)-1] = 'x';
  58. format(databaseIP[connect], 20, tmpip);
  59. varSet(tmpip, varGet(tmpip) +1);
  60.  
  61. SetPVarInt(playerid, #tPosSet, gettime());
  62. return SetTimerEx("registerBot_pB", 700, false, #i , playerid);
  63. }
  64.  
  65. pFunction resetBot_pB(botid) {
  66. varSet(databaseIP[botid], 0);
  67. return databaseIP[botid][0] = EOS;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement