* Look up the continent code for a given IP address. *
* @note The code can be retrieved as an integer or string (2 characters). * @note Possible continent codes are AF, AS, EU, NA, OC, SA for
* Africa(1), Asia(2), Europe(3), North America(4), Oceania(5) and South America(6).
* @param ip The IP address to look up. * @param result The result of the geoip lookup. This param is optional.
* If the lookup does not succeed, the buffer is not modified.
* @return The result of the geoip lookup, 0 on a failed lookup.
AFRICA = 1
native Continent:geoip_continent_code( const
= "" )
I also suggest something like:
CONTINENT_ERROR = 0,
Then when you write code for it, you can do:
new const g_szContinentNames[Continent] =
get_user_ip(iPlayer, szIp, 31, 1);
new Continent:iCont = geoip_continent_code(szIp);
if( iCont == CONTINENT_ERROR )
client_print(client, print_chat, "You could not be found on the Earth!");
client_print(client, print_chat, "You are from %s? Awesome!", g_szContinentNames[iCont]);
It would have more readability.