Voke_Bass

Anti-IPChanger + Ini text file [UPDATED 2021-10-09]

Feb 25th, 2019 (edited)
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.54 KB | None | 0 0
  1. //Updated 2021.10.09 | Rewiews: 254 | Tested, working, beta!
  2. //Created by Vok3 | more: https://pastebin.com/u/Voke_Bass
  3.  
  4. /*First create a text file using the /path command, you can find the text file in /scriptfiles/AntiIPConnect.ini
  5. (!) You can only edit IP%i texts, add will not work you have to increase the MAX_IP limit! Replace instead of 0.000000 text.
  6. (VIEW PHOTOS) https://i.imgur.com/WihfxYJ.png
  7. */
  8.  
  9. #include <dini>
  10. #define MAX_IP 200
  11. #define PATH "AntiIPConnect.ini"
  12.  
  13. public OnPlayerConnect(playerid)
  14. {
  15.     new file[128];
  16.     format(file, sizeof(file), "%s", PATH);
  17.     if(!dini_Exists(file)) return 1;
  18.  
  19.     new Float:ip[MAX_IP];
  20.    
  21.     new Player_IP[16];
  22.     new string_1[128];
  23.     new string_2[128];
  24.    
  25.     new max_i;
  26.     for(new i; i < MAX_IP; i++)
  27.     {
  28.         max_i++;
  29.         format(string_1, sizeof(string_1), "IP%i", max_i);
  30.         ip[max_i] = dini_Float(file, string_1);
  31.  
  32.         format(string_2, sizeof(string_2), "%s", ip[max_i]);
  33.  
  34.         GetPlayerIp(playerid, Player_IP, sizeof(Player_IP));
  35.  
  36.         if(strcmp(Player_IP, string_2, true))
  37.         {
  38.             new String[150];
  39.             format(String, sizeof(String), "[Anti-Cheat] Player %s was kicked out of the server!", /*GetPlayerName*/);
  40.             SendClientMessageToAll(-1, String);
  41.             Kick(playerid);
  42.         }
  43.     }
  44.     return 1;
  45. }
  46.  
  47. public OnPlayerCommandText(playerid, cmdtext[])
  48. {
  49.     if(!strcmp(cmdtext, "/path", true))
  50.     {
  51.         new file[128];
  52.         format(file, sizeof(file), "%s", PATH);
  53.         dini_Create(file);
  54.        
  55.         dini_IntSet(file, "Max IP", MAX_IP);
  56.  
  57.         new max_i;
  58.         new string_1[24];
  59.         for(new i; i < MAX_IP; i++)
  60.         {
  61.             max_i++;
  62.             format(string_1, sizeof(string_1), "IP%i", max_i);
  63.             dini_FloatSet(file, string_1, 0.0);
  64.         }
  65.         return 1;
  66.     }
  67.     return 0;
  68. }
  69.  
  70.  
  71.  
  72. //Updated 2020.04.15 | Rewiews: 140 | Tested, working!
  73. //Created by Vok3 | more: https://pastebin.com/u/Voke_Bass
  74.  
  75. public OnPlayerConnect(playerid)
  76. {
  77.     new String[150];
  78.     new PlayerIp[16];
  79.     GetPlayerIp(playerid, PlayerIp, sizeof(PlayerIp));
  80.  
  81.     //You must use || to add more IP addresses.
  82.     if(strcmp(PlayerIp, "00.000.000.000", true) || strcmp(PlayerIp, "00.000.000.000", true))
  83.     {
  84.         format(String, sizeof(String), "[Anti-Cheat] Player %s was kicked out of the server!", /*GetPlayerName*/);
  85.         SendClientMessageToAll(-1, String);
  86.         Kick(playerid);
  87.     }
  88.     return 1;
  89. }
  90.  
  91. _______________________________________________________________________________________________________________________________________
  92. More anti-cheats: https://www.supergames.lt/topic/317050-platinu-anti-cheat-sistemas-2/.
Add Comment
Please, Sign In to add comment