[Include] GEO-IP (GEOIP) V2 | Supports States and Cities
#1

VERSION 3.1 Updated (30/Mar/2015)
No need to use the one below (unless you really need to), just visit the above link!



۞ HISTORY
It's been over 3 years since I released any Script. But, now I am giving you the Version 2.0 (Updated to 2.1 on 12/31/2012) of the Legen ... wait for it ... dary Geo-IP Script. Earlier version was a simple filterscript that worked on the file handling method. But this one is better and uses SQLite Database instead of plan old file handling way.
NOTE : Read the Change Log below to know about the changes made in recent versions of the script.

۞ DESCRIPTION
The GEO-IP Script helps to provide the Geographical Location of a any player according to his/her Public IP Address. But, do not expect too much accurate results. The results will be somewhere near to the exact location. Using this script is very easy and does not needs much experience of scripting.
۞ SUB VERSIONS
FULL
  • Gives Country, State and City Location.
  • Uses a BIG Database (114MB)
  • Might lag on slow/personal servers (like 1 sec lag when someone joins)
LITE
  • Gives Country Location only.
  • Uses a Small Database (2.82MB)
  • Comparatively much faster
۞ USAGE
FULL
  1. Remove any old version(s) of GEO-IP / GEO-IP Lite or there are chances that newer version will show some glitches.
  2. Extract the contents of the archive into your SAMP Server directory OR Manually place all the files from the archives to the respective folders in the SAMP server directory.
  3. Now open your filterscript and add
    Код:
    #include <geo_ip>
    just below #include <a_samp>
  4. Now you can use the function anywhere like this
    Код:
    new Country[16], State[128], City[128];
    isLocal=GetPlayerLocation(playerid,Country,State,City);
    OR
    Код:
    new Country[16], State[128], City[128];
    isLocal=GetPlayerLocation(playerid,Country,State,City,1);
    The third parameter is optional. It is isotype parameter. You will find more info about it below, in the FUNCTIONS section.
LITE
  • 1st step same as above.
  • Now open your filterscript and add
    Код:
    #include <geo_ip_lite>
    just below #include <a_samp>
  • Now you can use the function anywhere like this
    Код:
    new Country[16];
    isLocal=GetPlayerLocation(playerid,Country);
    OR
    Код:
    new Country[16];
    isLocal=GetPlayerLocation(playerid,Country,1);
    The third parameter is optional. It is isotype parameter. You will find more info about it below, in the FUNCTIONS section.

۞ FUNCTIONS
FULL
  • GetPlayerLocation(playerid, Country[],State[], City[],isotype);
    • Returns 0 when connecting to the local server, otherwise 1.
    • Country[] hold the string of the country name and "Localhost" is you are connecting to local server.
    • State[] and City[] hold the string values of the State and City for the give IP.
    • isotype (OPTIONAL) is set to 2 by default and is an optional parameter. The valid values for isotype are :
      • 0 (Default) = 2 Alphabet name. Like IN
      • 1 = 3 Alphabet name. Like IND
      • 2 = Full Country Name. Like INDIA

  • GetPlayerCountry(playerid,isotype);
    • Returns the Country as string (according to the isotype, if provided, as isotype is default to 2 for this one).
  • GetPlayerProvince(playerid);
    • Returns the State/Province as string.
  • GetPlayerCity(playerid);
    • Returns the City as string.
LITE
  • GetPlayerLocation(playerid, Country[],isotype);
    • Returns 0 when connecting to the local server, otherwise 1.
    • Country[] hold the string of the country name and "Localhost" is you are connecting to local server.
    • isotype (OPTIONAL) is set to 2 by default and is an optional parameter. The valid values for isotype are :
      • 0 = 2 Alphabet name. Like IN
      • 1 = 3 Alphabet name. Like IND
      • 2(Default) = Full Country Name. Like INDIA

  • GetPlayerCountry(playerid,isotype);
    • Returns the Country as string.
۞ DOWNLOADS
4Shared Links MegaCloud Links
۞ CHANGE LOG
  • FIXES
    • FULL 2.1/LITE 2.1 : Compiler crash due to native function prototypes inside the include script.
    • LITE 2.1 : Wrong Database name. It was using the FULL DATABASE for operation instead of LITE one.

  • FEATURES
    • FULL 2.0/LITE 2.0 : Now the script works using a SQLite Database and not the CSV file (as it was slower and messy). Improved execution speed and HUGE database (FULL version).
    • FULL 2.0 : Now you can get names of States and Cities along with the Country name for any IP.
    • FULL 2.1 / LITE 2.1 : Now you can choose the Country Name Type by passing the opional parameter isotype. It has 3 options, 2 alphabet name, 3 alphabet name, and full name. (READ MORE in FUNCTIONS section)
۞ CREDITS
۞ SUPPORT
You are most welcomed to inform me about any bugs/improvements and all other type of feedback in/of this script. I'd be more than glad to help.
Reply


Messages In This Thread
GEO-IP (GEOIP) V2.1 | Supports Country(3 ISO-Types), State and City - by abhinavdabral - 29.12.2012, 22:16
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by tungki - 29.12.2012, 22:25
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Rillo - 29.12.2012, 22:34
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Niko_boy - 30.12.2012, 11:23
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Konstantinos - 30.12.2012, 11:44
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 30.12.2012, 14:07
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Konstantinos - 30.12.2012, 14:12
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 30.12.2012, 14:25
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by vMapper - 30.12.2012, 14:26
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 30.12.2012, 14:31
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Konstantinos - 30.12.2012, 14:35
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by DJTunes - 30.12.2012, 14:40
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by vMapper - 30.12.2012, 14:46
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by IstuntmanI - 30.12.2012, 14:50
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by AndreT - 30.12.2012, 15:01
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 30.12.2012, 16:27
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by totar - 02.02.2013, 05:15
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 02.02.2013, 14:18
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by [GF]Logic - 02.02.2013, 14:29
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 02.02.2013, 14:35
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by IstuntmanI - 02.02.2013, 16:23
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 02.02.2013, 18:07
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Lordzy - 19.02.2013, 03:40
Thank You - by abhinavdabral - 19.02.2013, 05:06
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by IstuntmanI - 02.03.2013, 11:57
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 02.03.2013, 16:09
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by RajatPawar - 03.03.2013, 11:02
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Hiddos - 03.03.2013, 11:36
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 03.03.2013, 12:04
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by IstuntmanI - 02.04.2013, 16:27
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 02.04.2013, 16:56
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by d0nTtoucH - 28.07.2013, 12:13
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by abhinavdabral - 28.07.2013, 12:24
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by d0nTtoucH - 28.07.2013, 12:25
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Saleem - 30.07.2013, 15:15
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Poschi - 30.03.2016, 13:35
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by IstuntmanI - 30.03.2016, 13:42
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Leopards - 24.07.2016, 20:59
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by Leopards - 26.07.2016, 11:31
Re: GEO-IP (GEOIP) V2 | Supports States and Cities - by yvoms - 13.06.2017, 20:25

Forum Jump:


Users browsing this thread: 1 Guest(s)