SA-MP Forums

SA-MP Forums (
-   Plugin Development (
-   -   [Plugin] GeoIP Plugin v0.1.4 (Country detector) - 04/05/2008 (

Totto8492 31/03/2008 07:43 AM

GeoIP Plugin v0.1.4 (Country detector) - 04/05/2008
This is my first practical plugin.
Ah... I don't know what to say.
If you can't read this post (as English), I'm too foolish.

* Last Edit: 04/05/2008:
GeoIP*.dat were move to scriptfiles directory.
Changes arguments(Pawn function).
Pawn functions will return string or value.
Fixed bug in sample filterscript.
Updated GeoIP*.dat.

Native Functions:

// Two chars into country[]. JP, US, etc...
native GetCountryCode(const ipaddress[], country[], size = sizeof country);
// Three chars into country[]. JPN, USA, etc...
native GetCountryCode3(const ipaddress[], country[], size = sizeof country);
// Full name into country[]. Japan, United States, etc...
native GetCountryName(const ipaddress[], country[], size = sizeof country);
// etc.

Pawn Functions:

GetPlayerCountryName(playerid); // return country name.
GetPlayerGMT(playerid); // return GMT hour. maybe inaccurate.
// etc.

Please see . I cant write well. Sorry.


#include <a_samp>
#include GeoIP_Plugin
public OnPlayerConnect(playerid)
        new name[MAX_PLAYER_NAME], country[MAX_COUNTRY_NAME], gmt;
        new string[256];

        GetPlayerName(playerid, name, sizeof(name));

        country = GetPlayerCountryName(playerid);
        gmt = GetPlayerGMT(playerid);

        format(string, sizeof(string), "[JOIN] %s (%s, GMT %d:00)", name, country, gmt);

        SendClientMessageToAll(0xFFCFCFAA, string);
        return 1;

Welcome review and complaints.
Maybe, I can read English. Maybe. (Package) (Source)
GeoIP_country_name_253.txt (Country name list from GeoIP.c)

kc 31/03/2008 11:37 AM

Re: GeoIP Plugin (Country detector)
very nice!!

makes my GeoIP function pointless tho :p

but who cares as this is much better ^^

yom 31/03/2008 11:42 AM

Re: GeoIP Plugin (Country detector)
This is awesome if it works :)

I can't test actually but will do and post comments

But i already have a suggestion (easily scriptable in Pawn but may be better directly coded in the plugin) :
pawn Code:

Return the GMT time of the player (based on his location of course)

Also you should post a list of all detected countries ;)

Last thing: what are functions *Code3 ?

Killerkid 31/03/2008 11:44 AM

Re: GeoIP Plugin (Country detector)
Nice work, But it's like the same as:

kc 31/03/2008 02:29 PM

Re: GeoIP Plugin (Country detector)

Originally Posted by Killerkid.
Nice work, But it's like the same as:

yeah but the gtasync one only gives the raw whois data. from the functions shown this one actually breaks it down into the output thats needed (country code etc.)

I made a pawn function based on the gtasync one, but i got bored trying to find out how to parse the data properly through pawn (its easily possible but just the time needed for all the different outputs of all the different whois providers.

Totto8492 01/04/2008 07:12 AM

Re: GeoIP Plugin v0.1.2 (Country detector) - 04/01/2008
I will write reply later.
today, busy. :'(
Sorry, my bad english.
Thanks for comments.

Totto8492 02/04/2008 02:12 AM

Re: GeoIP Plugin v0.1.2 (Country detector) - 04/01/2008
The original author?
I checked MyMessages. but, no messages.
Is he
If this post have any problem, I want to delete this.
I'm sorry.

Towlies 02/04/2008 09:31 PM

Re: GeoIP Plugin v0.1.2 (Country detector) - 04/01/2008
The creator of the plugin and owner of GTASync is a fella by the name of TheSmoo (alias).

I tried to get him to allow permission to release this on the forums but he didn't budge. Even though you have put great work into this the original author of the plugin doesn't want it released here.

Totto8492 03/04/2008 05:46 AM

Re: GeoIP Plugin v0.1.2 (Country detector) - 04/01/2008
(I'm unsure spelling)
I think my GeoIP Plugin is not related to GTASync's Plugin(is SNet, isn't it?).

his plugin:
Data source - WHOIS
Speed - depend network
Output - detailed host data(parse needed but good)

my plugin:
Data source - GeoIP
Speed - depend CPU
Output - country and a few things

By the way, his plugin source contain libGeoIP.
but libGeoIP is unused currently(#include only, not called).

and I don't use any his code.

So, Ah...well..., I think my plugin is not related to his plugin.

Still, Cannot I release here?
Should I Contact him?

Thanks in advance.

kc 03/04/2008 06:36 PM

Re: GeoIP Plugin v0.1.2 (Country detector) - 04/01/2008

Originally Posted by Totto8492
<Links removed>

Note from Towlies: The original author of this plugin does not want it publically released on SA-MP forums (I asked him months ago). If you are able to recreate this without his original code your free to remake it. Sorry, its the original author of the plugin who doesn't want it released at least not here.


Originally Posted by Alex
No, they were just saying it was similar. It's clearly not the same so there's no problem.


All times are GMT. The time now is 12:02 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.