01.12.2012, 09:32
my problem is when the player connect it not showing the country it shows blank can anyone help me how to show the country when player connect? i use GeoIP_Plugin
My Message OnPlayerConnect
my native and stock
do i miss something?
My Message OnPlayerConnect
pawn Code:
new IP[128];
GetPlayerIp(playerid,IP,sizeof(IP));
format(string, sizeof(string), "%s(%d) has joined the {FF0000}%s v%s {FFFFFF}Country(%s)", PlayerName(playerid), playerid, svname, sversion, GetPlayerCountryName(playerid));
SendClientMessageToAll(COLOR_CYAN, string);
pawn Code:
const MAX_COUNTRY_NAME = 45;
native GetCountryCode(const ipaddress[], country[], size = sizeof country);
native GetCountryCode3(const ipaddress[], country[], size = sizeof country);
native GetCountryName(const ipaddress[], country[], size = sizeof country);
native GetCityLatitude(const ipaddress[], &Float:lat);
native GetCityLongitude(const ipaddress[], &Float:lon);
native GetCountryCodeByName(const name[], country[], size = sizeof country);
native GetCountryCode3ByName(const name[], country[], size = sizeof country);
native GetCountryNameByName(const name[], country[], size = sizeof country);
native GetCityLatitudeByName(const name[], &Float:lat);
native GetCityLongitudeByName(const name[], &Float:lon);
stock GetGMT(const ip[])
{
new Float:lon;
GetCityLongitude(ip, lon);
return floatround(lon / 15.0);
}
stock GetGMTByName(const Cname[])
{
new Float:lon;
GetCityLongitudeByName(Cname, lon);
return floatround(lon / 15.0);
}
stock GetPlayerGMT(playerid)
{
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
return GetGMT(ip);
}
stock GetPlayerCountryCode(playerid)
{
new ip[16], country[MAX_COUNTRY_NAME];
GetPlayerIp(playerid, ip, sizeof(ip));
GetCountryCode(ip, country, size);
return country;
}
stock GetPlayerCountryCode3(playerid)
{
new ip[16], country[MAX_COUNTRY_NAME];
GetPlayerIp(playerid, ip, sizeof(ip));
GetCountryCode3(ip, country, size);
return country;
}
stock GetPlayerCountryName(playerid)
{
new ip[16], country[MAX_COUNTRY_NAME];
GetPlayerIp(playerid, ip, sizeof(ip));
new ret = GetCountryName(ip, country, sizeof(country));
if(!ret)
format(country, sizeof(country), " ");
return country;
}