PDA

View Full Version : GeoIP example uses?


PowerF
19/08/2015, 01:15 PM
Is there any example uses for using GeoIP include?
I want to make it like this if the player is connecting

"Someone Has Been Connected(New York)"

(Get player's city)

rymax99
19/08/2015, 03:01 PM
The functions for the include are pretty straightforward. http://forum.sa-mp.com/showthread.php?t=296171


new pName[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
new country[54],
string[128];
GetPlayerName(playerid, pName[playerid], MAX_PLAYER_NAME);
GetPlayerCountry(playerid, country, sizeof(country));
format(string, sizeof(string), "%s has joined the server from %s.", pName[playerid], country);
SendClientMessageToAll(-1, string);
}

PowerF
20/08/2015, 08:55 AM
so,i can change the GetPlayerCountry to GetPlayerCity?

rymax99
20/08/2015, 11:01 AM
so,i can change the GetPlayerCountry to GetPlayerCity?

Yes. You would have to change the string size to account for longer city names.