31.03.2008, 06:43
(
Last edited by dugi; 04/07/2010 at 12:43 PM.
)
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:
Pawn Functions:
Please see GeoIP_Plugin.inc . I cant write well. Sorry.
Example:
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)
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.
Code:
GetPlayerCountryName(playerid); // return country name. GetPlayerGMT(playerid); // return GMT hour. maybe inaccurate. // etc.
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; }
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)