Guest User

Anti Bot by HavingGood

a guest
Nov 30th, 2012
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.13 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 bot attacking the 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. PlayerName(playerid)
  38. {
  39.     new pName[MAX_PLAYER_NAME];
  40.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  41.     return pName;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment