|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Mar 2009
Location: Cloud 9
Posts: 2,295
Reputation: 223
|
Ip Locator 1.1 What does it do? Quite simple, it adds a callback that gets called just after a player connects. The players country and city are sent to a the callback as two strings. The data is retrieved from this site http://www.hostip.info/ When a player connects a HTTP get request is sent with the players ip to the site above, when the site responds OnRetrieveIpLocation will be called. (after everything in OnPlayerConnect) Example FS pawn Code:
NOTE: If an ip isn't stored on that site it's country will be "Private country" (this happens with localhost too). I could also add lat/lon but i thought that would be pretty pointless. If anyone spots any bugs please point them out and ill try fix em. UPDATE 1.1
Download: http://dl.dropbox.com/u/76608104/iploc1.1.inc Alternative: If this isn't what your after try slices plugin free GeoIp filterscript. Slices plugin free GeoIp: http://forum.sa-mp.com/showthread.php?t=190699 Last edited by iggy1; 01/05/2012 at 09:42 AM. Reason: Added geoip FS link |
|
|
|
|
|
#2 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jan 2010
Location: Canary Islands, Spain
Posts: 1,372
Reputation: 157
|
Pretty nice man, like it. Short but useful.
5/5
|
|
|
|
|
|
#3 |
|
Gangsta
![]() ![]() ![]() ![]() Join Date: Dec 2010
Location: Romania, Arad
Posts: 871
Reputation: 53
|
Nice, ... i will try it tomorrow, if works perfectlly, i will use it
!
|
|
|
|
|
|
#4 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2010
Location: INDIA !!! :)) Punjab
Posts: 1,078
Reputation: 107
|
this is nice and this will be may be more accurate ![]() A Question: Can i use it to retrieve info customly e.g. a command /getloc <playerid> and get his ip in command and use it some how ? or it works only in OnPlayerConnect? i mean if there be stock or something will make this more cool :/ EDIT: i trying it now , but its no working O.o Last edited by Niko_boy; 26/04/2012 at 03:52 PM. |
|
|
|
|
|
#5 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2009
Location: Home
Posts: 2,351
Reputation: 212
|
Nice way do detect and quite fast. Good job.
|
|
|
|
|
|
#6 |
|
Banned
![]() Join Date: Apr 2012
Location: Inside SA-MP
Posts: 297
Reputation: 38
|
Nice! Good Job nice and clean!
|
|
|
|
|
|
#7 | |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Mar 2009
Location: Cloud 9
Posts: 2,295
Reputation: 223
|
Quote:
You could also make that command yourself with the callback provided, just store the country/city in an array, and have a function return it. (or just use the var in the command) If i added a function to get the players country, people would more than likely use it in OnPlayerConnect and it wouldn't work. I thought a callback would be the simplest way. If there was a way for me to get the HTTP response instantly i would have added more funcs. Thanks all for positive feedback. |
|
|
|
|
|
|
#8 | |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2010
Location: INDIA !!! :)) Punjab
Posts: 1,078
Reputation: 107
|
Welcome.
Quote:
it must say Private COuntry , but it isnt doing so O.o ? nor it called the Function... OnRetrieveIpLocation .. i tried to debug where it is CallLocalFunction("onretrieve.. and debug also showed no results .. ? wtabout that ? |
|
|
|
|
|
|
#9 |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Mar 2009
Location: Cloud 9
Posts: 2,295
Reputation: 223
|
I'll just check it again now, i'm quite sure it was working when i posted it. I will edit this post.
EDIT: It works for me, check your server log for the http response. pawn Code:
server_log: Code:
[17:37:41] playerid 0, joined from country private country, city private address |
|
|
|
|
|
#10 | |
|
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2010
Location: INDIA !!! :)) Punjab
Posts: 1,078
Reputation: 107
|
Nop nothing in there :/
Quote:
and i use code u posted in ur first post no message is send + as i said earleir the Fucntion isnt gettign called.aight i g2g atm :. i will get back to thread and try the script tommorow again : |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Include] GeoIP (ISP, Country, City) | Whitetiger | Includes | 75 | 14/04/2013 09:53 PM |
| How to get playerid under such callback as OnVehicleSpawn | [WSF]ThA_Devil | Help Archive | 7 | 01/08/2011 01:53 PM |
| Favorite Country Side City? | Darklom | Everything and Nothing | 15 | 22/03/2011 12:18 AM |
| OnPlayerInfoChange(playerid) callback | ledzep | Help Archive | 7 | 08/04/2009 02:05 AM |