SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 19/06/2015, 01:15 PM   #1
Huge Clucker
Join Date: Aug 2014
Location: Locating...
Posts: 280
Reputation: 0
Lightbulb getting location

i really need this but i cant script it. a code for under onplayerconnect
[10:08:26] {DDDDDD}PrinceGuaNa[TWN] (6){C0C0C0} has joined the server [Taiwan]
help me if you know how make these codes that get location, thanks.
suni is offline   Reply With Quote
Old 19/06/2015, 03:14 PM   #2
Big Clucker
DDR3's Avatar
Join Date: Jun 2013
Posts: 141
Reputation: 6
Default Re: getting location

public OnPlayerText(playerid, text[])
        hours, // Variable for hours
        minutes, // Variable for minutes
        seconds, // Variable for seconds
        string[128], // String
        name[MAX_PLAYER_NAME] // String for name
    GetPlayerName(playerid,name,sizeof(name)); // Get the typer's name
    gettime(hours, minutes, seconds); // Get the time and store it into the variables above
    format(string,sizeof(string),"[%d:%d:%d] %s says: %s",hours,minutes,seconds,name,text); // Formats the text with the time variables
    SendClientMessageToAll( -1, string); // Send the message to all
    return 0; // Returning 0 will disable the traditional SAMP chat.

DDR3 is offline   Reply With Quote
Old 19/06/2015, 03:46 PM   #3
Huge Clucker
Join Date: Aug 2014
Location: Locating...
Posts: 280
Reputation: 0
Default Re: getting location

thanks for replying but i mean displaying the player's location next to their name
PrinceGuaNa[TWN] has joined the server [Taiwan] <<<the player's country name
suni is offline   Reply With Quote
Old 19/06/2015, 04:04 PM   #4
Stanford's Avatar
Join Date: Feb 2012
Posts: 1,028
Reputation: 84
Default Re: getting location

You can use which is provided by Emmet_ or use GEOIP, but I recommend Emmet_'s.

To use Emmet_'s here's the structure:
GetPlayerCountry(playerid, country[], size = sizeof(country));

I hope I helped any feedback is appreciated!
Y_Less: "That code compiles perfectly, but I can tell you now it won't make me a cup of tea."

Y_Less: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. They don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."
Stanford is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VPS Location Help Fernado Samuel Server Support 5 23/09/2013 11:47 AM
Location help? TheMightyEddy Scripting Help 5 11/04/2012 12:17 AM
Location help pls Tanush123 Scripting Help 1 29/10/2011 08:00 PM
Location Almog Help Archive 3 04/03/2011 12:03 PM
Location Robbin237 Help Archive 4 10/07/2009 12:49 PM

All times are GMT. The time now is 10:56 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.