2004-09-10 03:12:38 +00:00
|
|
|
/* GeoIP module functions for AMX Mod X
|
|
|
|
by David "BAILOPAN" Anderson
|
|
|
|
(C)Copyrighted under the GNU General Public License, Version 2
|
|
|
|
*/
|
|
|
|
|
2006-10-24 17:13:02 +00:00
|
|
|
#if defined _geoip_included
|
2004-09-10 03:12:38 +00:00
|
|
|
#endinput
|
|
|
|
#endif
|
|
|
|
#define _geoip_included
|
|
|
|
|
2006-05-10 10:42:49 +00:00
|
|
|
#if AMXX_VERSION_NUM >= 175
|
|
|
|
#pragma reqlib geoip
|
|
|
|
#if !defined AMXMODX_NOAUTOLOAD
|
|
|
|
#pragma loadlib geoip
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#pragma library geoip
|
|
|
|
#endif
|
2004-09-10 03:12:38 +00:00
|
|
|
|
|
|
|
//IP address can contain ports, the ports will be stripped out
|
|
|
|
|
|
|
|
//get a two character country code (eg US, CA etc)
|
|
|
|
native geoip_code2(ip[], ccode[3]);
|
|
|
|
|
2006-12-11 04:07:55 +00:00
|
|
|
//get a three character country code (eg USA, CAN etc)
|
2004-09-10 03:12:38 +00:00
|
|
|
native geoip_code3(ip[], result[4]);
|
|
|
|
|
|
|
|
//get a full country name. max name is 45 chars
|
|
|
|
native geoip_country(ip[], result[], len=45);
|