SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 31/03/2008, 06:43 AM   #1
Totto8492
Little Clucker
 
Join Date: Jan 2007
Posts: 7
Reputation: 5
Default 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.
Added MAX_COUNTRY_NAME.
Changes arguments(Pawn function).
Pawn functions will return string or value.
Fixed bug in sample filterscript.
Updated GeoIP*.dat.

Native Functions:
Code:
// 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:
Code:
GetPlayerCountryName(playerid); // return country name.
GetPlayerGMT(playerid); // return GMT hour. maybe inaccurate.
// etc.
Please see GeoIP_Plugin.inc . I cant write well. Sorry.

Example:
Code:
#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.

geoip_plugin-0.1.4.zip (Package)
geoip_plugin-src-0.1.4.zip (Source)
GeoIP_country_name_253.txt (Country name list from GeoIP.c)

Last edited by dugi; 04/07/2010 at 12:43 PM.
Totto8492 is offline   Reply With Quote
Old 31/03/2008, 10:37 AM   #2
kc
High-roller
 
kc's Avatar
 
Join Date: Aug 2007
Posts: 1,169
Reputation: 107
Default Re: GeoIP Plugin (Country detector)

very nice!!

makes my GeoIP function pointless tho

but who cares as this is much better ^^
kc is offline   Reply With Quote
Old 31/03/2008, 10:42 AM   #3
yom
High-roller
 
Join Date: Jul 2006
Posts: 2,015
Reputation: 5
Default 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:
GetPlayerGMT(playerid);

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 ?
yom is offline   Reply With Quote
Old 31/03/2008, 10:44 AM   #4
Killerkid
Gangsta
 
Join Date: Sep 2006
Location: UK
Posts: 714
Reputation: 1
Default Re: GeoIP Plugin (Country detector)

Nice work, But it's like the same as: http://gtasync.com/?p=13
Killerkid is offline   Reply With Quote
Old 31/03/2008, 01:29 PM   #5
kc
High-roller
 
kc's Avatar
 
Join Date: Aug 2007
Posts: 1,169
Reputation: 107
Default Re: GeoIP Plugin (Country detector)

Quote:
Originally Posted by Killerkid.
Nice work, But it's like the same as: http://gtasync.com/?p=13
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.
kc is offline   Reply With Quote
Old 01/04/2008, 06:12 AM   #6
Totto8492
Little Clucker
 
Join Date: Jan 2007
Posts: 7
Reputation: 5
Default 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 is offline   Reply With Quote
Old 02/04/2008, 01:12 AM   #7
Totto8492
Little Clucker
 
Join Date: Jan 2007
Posts: 7
Reputation: 5
Default Re: GeoIP Plugin v0.1.2 (Country detector) - 04/01/2008

The original author?
I checked MyMessages. but, no messages.
Is he MaxMind.com?
If this post have any problem, I want to delete this.
I'm sorry.
Totto8492 is offline   Reply With Quote
Old 02/04/2008, 08:31 PM   #8
Towlies
Huge Clucker
 
Join Date: Jul 2006
Posts: 498
Reputation: 0
Default 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.
Towlies is offline   Reply With Quote
Old 03/04/2008, 04:46 AM   #9
Totto8492
Little Clucker
 
Join Date: Jan 2007
Posts: 7
Reputation: 5
Default 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.
Maybe.

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

Thanks in advance.
Totto8492 is offline   Reply With Quote
Old 03/04/2008, 05:36 PM   #10
kc
High-roller
 
kc's Avatar
 
Join Date: Aug 2007
Posts: 1,169
Reputation: 107
Default Re: GeoIP Plugin v0.1.2 (Country detector) - 04/01/2008

Quote:
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.
Quote:
Originally Posted by Alex
No, they were just saying it was similar. It's clearly not the same so there's no problem.
:/
kc is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prob with plugin on Windows 2008 Root ULSA Night Plugin Development 0 10/04/2010 08:13 AM
[FilterScript] [FS] Short and simple teleport dialog from country to country bartje01 Filterscripts 2 18/03/2010 01:31 PM
Bug detector lithuania154 Client Support 2 15/07/2009 08:00 PM
KOM on MTA RU Photosession 2008 (Christmas Movie) - 27.12.2008 Legenda Screenshots and Videos 8 12/07/2009 02:49 PM


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


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