17.05.2016, 10:19
(
Last edited by Banana_Ghost; 05/06/2016 at 10:04 AM.
)
Hi,
Emmet was the original designer of the code (Original Thread: https://sampforum.blast.hk/showthread.php?tid=521843). I picked this up off the forums a while ago after I got tired of updating GeoIP databases. Unfortunately, the code I found from Emmet's post no longer worked as the search API no longer worked. So I found a new API that did work, reworked the code around to get it to work with the new API, and added support for viewing the ISP of an IP Address.
Functions:
Callback:
Using things like this saves a lot of time by not having to ALT + Tab to ****** an IP Address to find the information.
API used is http://ip-api.com.
Note if you do over 150 queries within 1 minute, you'll get your server's IP banned for flooding.
Complete documentation for the API is here.
Link:
http://pastebin.com/h7MYhriH
Emmet was the original designer of the code (Original Thread: https://sampforum.blast.hk/showthread.php?tid=521843). I picked this up off the forums a while ago after I got tired of updating GeoIP databases. Unfortunately, the code I found from Emmet's post no longer worked as the search API no longer worked. So I found a new API that did work, reworked the code around to get it to work with the new API, and added support for viewing the ISP of an IP Address.
Functions:
Code:
GetPlayerCountry(playerid, country[], size = sizeof(country)); GetPlayerRegion(playerid, region[], size = sizeof(region)); GetPlayerCity(playerid, city[], size = sizeof(city)); GetPlayerISP(playerid, isp[], size = sizeof(isp)); GetPlayerTimezone(playerid, timezone[], size = sizeof(timezone)); GetPlayerZipcode(playerid, zipcode[], size = sizeof(zipcode));
Code:
public OnLookupComplete(playerid){ return 1; }
API used is http://ip-api.com.
Note if you do over 150 queries within 1 minute, you'll get your server's IP banned for flooding.
Complete documentation for the API is here.
Link:
http://pastebin.com/h7MYhriH