01.11.2013, 11:49
What's the point of storing the country to both PVar and variable? One would be better.
Anyways, use either:
Or:
However, it might fail to show the country in-time due to the time is needed for the HTTP to get the data and call GeoIPLookingFor.
Anyways, use either:
pawn Код:
public GeoIPLookingFor( playerid, response_code, data[ ] )
{
strmid( PlayerCountry[ playerid ], data, 9, strfind( data, "City:", false ) - 1 );
SetPVarString( playerid, "Player_Country", PlayerCountry[ playerid ] );
return 1;
}
pawn Код:
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 );
strcat( ( PlayerCountry[ playerid ][ 0 ] = '\0', PlayerCountry[ playerid ] ), sz_Country, 32 );
return 1;
}

