Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /*VISITE NOSSO SITE: http://www.sampknd.com/
  2.   SAMP KND MELHOR BLOG DE SAMP DO BRASIL
  3. */
  4.  
  5. #include a_samp
  6.  
  7. #if !defined varGet
  8. #define varGet(%0)      getproperty(0,%0)
  9. #endif
  10.  
  11. // http://forum.sa-mp.com/showthread.php?p=1925909
  12.  
  13.  
  14. #if !defined varSet
  15. #define varSet(%0,%1) setproperty(0, %0, %1)
  16. #endif
  17.  
  18. stock botGetIP[24];
  19.  
  20. #define IsPlayerBot(%0)\
  21.             GetPlayerPing(%0) == 65535 && (gettime() - varGet((GetPlayerIp(%0, botGetIP, sizeof botGetIP), botGetIP)) > 5)
  22.  
  23.  
  24. public OnPlayerConnect(playerid) {
  25.  
  26.     if(IsPlayerNPC(playerid)) return false;
  27.  
  28.     static
  29.         playerip[24]
  30.     ;
  31.  
  32.     GetPlayerIp(playerid, playerip, 24);
  33.  
  34.     if(gettime() - varGet(playerip) < 2) {
  35.  
  36.          
  37.         strcat(playerip, "di_S");
  38.  
  39.         if(gettime() - varGet(playerip) < 3) {
  40.             return false;
  41.         }
  42.          
  43.         printf("%d Entrou em menos de 2 segundos", playerid);
  44.  
  45.         GetPlayerIp(playerid, playerip, 20);
  46.  
  47.         varSet(playerip, gettime());
  48.  
  49.         strcat(playerip, "x");
  50.  
  51.         static timers ;
  52.         timers = varGet(playerip);
  53.  
  54.         varSet(playerip, 1+ timers);
  55.  
  56.         if(timers > 2) {
  57.  
  58.             playerip[strlen(playerip) - 2] = 0;
  59.  
  60.             printf("BOT: ID -> %d IP -> %s", playerid, playerip);
  61.             BanEx(playerid, "Bot Connect");
  62.         }
  63.     }
  64.     return varSet(playerip, gettime());
  65. }
  66.  
  67.  
  68. public OnPlayerDisconnect(playerid, reason) {
  69.     if(reason == 2) {
  70.  
  71.         static
  72.             playerip[20]
  73.         ;
  74.  
  75.  
  76.         GetPlayerIp(playerid, playerip, 20);
  77.         strcat(playerip, "di_S");
  78.  
  79.         varSet(playerip, gettime());
  80.     }
  81.     return false;
  82.  
  83. }