Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Updated 2021.10.09 | Rewiews: 254 | Tested, working, beta!
- //Created by Vok3 | more: https://pastebin.com/u/Voke_Bass
- /*First create a text file using the /path command, you can find the text file in /scriptfiles/AntiIPConnect.ini
- (!) 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.
- (VIEW PHOTOS) https://i.imgur.com/WihfxYJ.png
- */
- #include <dini>
- #define MAX_IP 200
- #define PATH "AntiIPConnect.ini"
- public OnPlayerConnect(playerid)
- {
- new file[128];
- format(file, sizeof(file), "%s", PATH);
- if(!dini_Exists(file)) return 1;
- new Float:ip[MAX_IP];
- new Player_IP[16];
- new string_1[128];
- new string_2[128];
- new max_i;
- for(new i; i < MAX_IP; i++)
- {
- max_i++;
- format(string_1, sizeof(string_1), "IP%i", max_i);
- ip[max_i] = dini_Float(file, string_1);
- format(string_2, sizeof(string_2), "%s", ip[max_i]);
- GetPlayerIp(playerid, Player_IP, sizeof(Player_IP));
- if(strcmp(Player_IP, string_2, true))
- {
- new String[150];
- format(String, sizeof(String), "[Anti-Cheat] Player %s was kicked out of the server!", /*GetPlayerName*/);
- SendClientMessageToAll(-1, String);
- Kick(playerid);
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/path", true))
- {
- new file[128];
- format(file, sizeof(file), "%s", PATH);
- dini_Create(file);
- dini_IntSet(file, "Max IP", MAX_IP);
- new max_i;
- new string_1[24];
- for(new i; i < MAX_IP; i++)
- {
- max_i++;
- format(string_1, sizeof(string_1), "IP%i", max_i);
- dini_FloatSet(file, string_1, 0.0);
- }
- return 1;
- }
- return 0;
- }
- //Updated 2020.04.15 | Rewiews: 140 | Tested, working!
- //Created by Vok3 | more: https://pastebin.com/u/Voke_Bass
- public OnPlayerConnect(playerid)
- {
- new String[150];
- new PlayerIp[16];
- GetPlayerIp(playerid, PlayerIp, sizeof(PlayerIp));
- //You must use || to add more IP addresses.
- if(strcmp(PlayerIp, "00.000.000.000", true) || strcmp(PlayerIp, "00.000.000.000", true))
- {
- format(String, sizeof(String), "[Anti-Cheat] Player %s was kicked out of the server!", /*GetPlayerName*/);
- SendClientMessageToAll(-1, String);
- Kick(playerid);
- }
- return 1;
- }
- _______________________________________________________________________________________________________________________________________
- More anti-cheats: https://www.supergames.lt/topic/317050-platinu-anti-cheat-sistemas-2/.
Add Comment
Please, Sign In to add comment