SA-MP Forums Archive
GeoIP example uses? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GeoIP example uses? (/showthread.php?tid=586113)



GeoIP example uses? - PowerF - 19.08.2015

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)


Re: GeoIP example uses? - rymax99 - 19.08.2015

The functions for the include are pretty straightforward. https://sampforum.blast.hk/showthread.php?tid=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);
}



Re: GeoIP example uses? - PowerF - 20.08.2015

so,i can change the GetPlayerCountry to GetPlayerCity?


Re: GeoIP example uses? - rymax99 - 20.08.2015

Quote:
Originally Posted by PowerF
Посмотреть сообщение
so,i can change the GetPlayerCountry to GetPlayerCity?
Yes. You would have to change the string size to account for longer city names.