Advertisement
Guest User

Anti bot by HavingGood

a guest
Nov 30th, 2012
468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.25 KB | None | 0 0
  1. /*
  2. ################################################################################
  3. # Anti Bot by HavingGood
  4. ################################################################################
  5. */
  6. #include <a_samp>
  7. #define RED 0xFF0000
  8. #define FILTERSCRIPT
  9.  
  10. new bt[20];
  11. new bt2[20];
  12. new Search;
  13.  
  14. public OnPlayerConnect(playerid)
  15. {
  16.     GetPlayerIp(playerid, bt, sizeof(bt));
  17.     for(new i=0; i<MAX_PLAYERS; i++)
  18.     {
  19.         if(!IsPlayerConnected(i) || i == playerid) continue;
  20.  
  21.         if(strcmp(bt2, bt)== 0)
  22.         GetPlayerIp(i, bt2, sizeof(bt2));
  23.         {
  24.             Search++;
  25.             if(Search >= 2)
  26.             {
  27.                 new strbt[28];
  28.                 format(strbt, sizeof(strbt), "Player %s has been banned for btting server", PlayerName(playerid));
  29.                 SendClientMessageToAll(RED, strbt);
  30.                 printf("*bt* %s(%d) MK %d", PlayerName(playerid), playerid, Search); //Dont delete this searching player IP.
  31.                 Ban(playerid); //Ban player
  32.                 //Kick(playerid); //This is kick
  33.                 return 1;}}}
  34.     return 1;
  35. }
  36.  
  37. public OnPlayerSpawn(playerid)
  38. {
  39. SendClientMessage(playerid,RED, "This server using AntiBot by HavingGood");
  40. return 1;
  41. }
  42.  
  43. PlayerName(playerid)
  44. {
  45.     new pName[MAX_PLAYER_NAME];
  46.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  47.     return pName;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement