I use now
pawn Код:
stock GeoIPLookFor(playerid)
{
new str[64],ip[16];
GetPlayerIp(playerid,ip,sizeof(ip));
format(str,64,"api.hostip.info/get_html.php?ip=%s",ip);
HTTP(playerid,HTTP_GET,str,"","GeoIPLookingFor");
return 1;
}
public GeoIPLookingFor( playerid, response_code, data[ ] )
{
new
sz_Country[ 32 ]
;
strmid( sz_Country, data, 9, strfind( data, "City:", false ) - 1 );
SetPVarString( playerid, "Player_Country", sz_Country );
PlayerCountry[playerid] = sz_Country;
SendClientMessage(playerid,-1, sz_Country);
return 1;
}
Line: SendClientMessage(playerid,-1, sz_Country); returns correctly, but the variable Player_Country returns nothing when i use it on OnPlayerConnect.
pawn Код:
GeoIPLookFor(playerid);
new pmsg[128];
GetPVarString(playerid, "Player_Country", pmsg, 128);// Get the msg string from the PVar
printf("Country: %s", pmsg);// will print 'Player Message: *message*'
[13:49:04] Country:
Any ideas?