Advertisement
VanGans

FS Anti Proxy

Aug 28th, 2020
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.34 KB | None | 0 0
  1. //Anti Proxy By VanGans
  2. // This is a comment
  3. // uncomment the line below if you want to write a filterscript
  4.  
  5. //Readme
  6. //Grand theft auto San Andreas multiplayer Filterscript that blocks anyone from joining the server with a proxy or VPN!
  7. //I had the problem of a cunt rejoining my server with a new ip just after I ban it, so I scraped this togeter and it //works pretty dank.
  8. //Will no longer kick anyone connecting from localhost (127.0.0.1)
  9.  
  10. #define FILTERSCRIPT
  11.  
  12. #include <a_samp>
  13. #include <a_http>
  14. #if defined FILTERSCRIPT
  15.  
  16. public OnFilterScriptInit()
  17. {
  18.     print("\n======================================");
  19.     print("     System Anti Proxy by VanGans       ");
  20.     print("======================================\n");
  21.     return 1;
  22. }
  23.  
  24. public OnFilterScriptExit()
  25. {
  26.     return 1;
  27. }
  28.  
  29. forward MyHttpResponse(playerid, response_code, data[]);
  30.  
  31.  
  32.  
  33. public OnPlayerConnect(playerid)
  34. {
  35.     new ip[16], string[59];
  36.     GetPlayerIp(playerid, ip, sizeof ip);
  37.     format(string, sizeof string, "www.shroomery.org/ythan/proxycheck.php?ip=%s", ip);
  38.     HTTP(playerid, HTTP_GET, string, "", "MyHttpResponse");
  39.     return 1;
  40. }
  41.  
  42.  
  43. public MyHttpResponse(playerid, response_code, data[])
  44. {
  45.     new name[MAX_PLAYERS],string[256];
  46.     new ip[16];
  47.     GetPlayerName(playerid, name, sizeof(name));
  48.     GetPlayerIp(playerid, ip, sizeof ip);
  49.     if(strcmp(ip, "127.0.0.1", true) == 0)
  50.     {
  51.         format(string, 256, "[LOCALHOST] %s(%d) has joined the server.", name, playerid);
  52.         SendClientMessageToAll( 0x09F7DFC8, string);
  53.         return 1;
  54.     }
  55.     if(response_code == 200)
  56.     {  
  57.         if(data[0] == 'Y')
  58.         {
  59.             format(string, 256, "[PROXY DETECTED] %s(%d) has been kicked from the server.", name, playerid);
  60.             SendClientMessageToAll( 0xFF0000FF, string);
  61.             SendClientMessage(playerid, 0xFF0000FF, "_________Please disable your proxy/VPN and rejoin!_________");
  62.             SetTimerEx("DelayedKick", 100, false, "i", playerid);
  63.         }
  64.         if(data[0] == 'N')
  65.         {
  66.             format(string, 256, "[PROXY NOT DETECTED] %s(%d) thank you for joining!", name, playerid);
  67.             SendClientMessageToAll( 0x09F7DFC8, string );
  68.         }
  69.         if(data[0] == 'X')
  70.         {
  71.             printf("WRONG IP FORMAT");
  72.         }
  73.         else
  74.         {
  75.             printf("The request failed! The response code was: %d", response_code);
  76.         }
  77.     }
  78.     return 1;
  79. }
  80.  
  81. forward DelayedKick(playerid);
  82. public DelayedKick(playerid)
  83. {
  84.     Kick(playerid);
  85.     return 1;
  86. }
  87.  
  88.  
  89. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement