-
Notifications
You must be signed in to change notification settings - Fork 1
/
anti-vpn.pwn
43 lines (37 loc) · 1012 Bytes
/
anti-vpn.pwn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#define FILTERSCRIPT
#include <a_samp>
#include <a_http>
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Anti VPN by Aleks4k(Propalica)");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
forward MyHttpResponse(playerid, response_code, data[]);
public OnPlayerConnect(playerid){
new ip[16], string[256];
GetPlayerIp(playerid, ip, sizeof ip);
format(string, sizeof string, "www.ip-api.com/json/%s?fields=proxy,hosting", ip);
HTTP(playerid, HTTP_GET, string, "", "MyHttpResponse");
return 1;
}
public MyHttpResponse(playerid, response_code, data[])
{
if(strfind(data, "true", true) != -1)
{
SendClientMessage(playerid, 0xFF0000FF, "Disable your VPN and rejoin!");
SetTimerEx("DelayedKick", 100, false, "i", playerid);
}
return 1;
}
forward DelayedKick(playerid);
public DelayedKick(playerid)
{
Kick(playerid);
return 1;
}