This include gets some information about player IP-address and keeps it during the game session.Available macros for use:
GetPlayerCountry(playerid) - get the name of the country in which the player is now located (string).
GetPlayerCity(playerid) - get the name of the city in which the player is now located (string).
GetPlayerLatitude(playerid) - get the latitude coordinates of the player (string).
GetPlayerLongtitude(playerid) - get the longtitude coordinates of the player (string).
GetPlayerProvider(playerid) - get the name of the provider of the player [ISP] (string).
GetPlayerProxyStatus(playerid) - does the player use proxy (string).
public OnPlayerConnect(playerid)
{
printf("Country: %s", GetPlayerCountry(playerid));
printf("City: %s", GetPlayerCity(playerid));
printf("Latitude: %s", GetPlayerLatitude(playerid));
printf("Longtitude: %s", GetPlayerLongtitude(playerid));
printf("Provider: %s", GetPlayerProvider(playerid));
printf("ProxyStatus: %s", GetPlayerProxyStatus(playerid));
return 1;
}
|
sscanf(data, "p<,>s[32]s[32]s[12]s[12]s[32]s[6]", ...);
sscanf(data, "p<,>s[" #GEO_MAX_COUNTRY_NAME_LENGTH "]s[" #GEO_MAX_CITY_NAME_LENGTH "]s[" #GEO_MAX_LAT_LON_LENGTH "]s[" #GEO_MAX_LAT_LON_LENGTH "]s[" #GEO_MAX_PROVIDER_NAME_LENGTH "]s[" #GEO_MAX_PROXY_LENGTH "]", ...);
GetPlayerCountry(playerid, dest[], len = sizeof dest)
Consider returning the result as a reference instead of the function returning mechanism which is known to be buggy when dealing with arrays (strings).
PHP Code:
|
#define GetPlayerCountry(%0) player_geoInfo[%0][player_country]
That's not the case here ,those are macros which will be replaced by corresponding array it specifies, on compile time.
PHP Code:
|
Proxy: Yes/No