SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 01/12/2012, 09:32 AM   #1
Patrick
Guest
 
Posts: n/a
Default Country On Player Connect

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
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);

my native and stock
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;
}

do i miss something?
  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
[FilterScript] GeoIPSAMP - Simple GeoLocation!, Knowing the Player Country. [CRZ]xRicard[O]x. Filterscripts 12 18/10/2012 02:41 AM
Testing for player plugin on player connect HondaCBR Help Archive 7 23/04/2011 12:14 PM
How to make country detection on connect? NiXeL Help Archive 4 21/06/2010 10:36 AM
I see some server connect have players country..how to add in gamemode ? simonall2 Help Archive 2 08/06/2009 01:25 PM


All times are GMT. The time now is 11:50 AM.


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