Jump to content

Coordinates


Tails

Recommended Posts

Posted

Hi, I was wondering if there is quick way to fetch coordinates from your ingame ped position? Like print them to the console for example.

Thanks in advance.

Discord: its.tails

Posted

No, but you can make one within seconds.

Functions you need:

addCommandHandler 
getElementPosition 
outputChatBox 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Sorry, am lost once again.

function getCoord() 
 local x,y,z = getElementPosition(thePlayer) 
 outputChatbox("Coordinates: " .. getElementPosition(thePlayer) .."", getRootElement(), 255,0,255, true) 
 end 
 addCommandHandler("coord", getCoord) 

function getCoord() 
 local x,y,z = getElementPosition(thePlayer) 
 outputChatbox("Coordinates:", getRootElement(), 255,0,255, true, x, y, z) 
 end 
 addCommandHandler("coord", getCoord) 

Discord: its.tails

Posted (edited)

--- edited .. thanks to Solidsnake14

  
function getCoord(thePlayer) 
local x,y,z = getElementPosition(thePlayer) 
outputChatBox("Coordinates:".." X"..x.." Y"..y.." Z"..z, getRootElement(), 255,0,255, true) 
end 
addCommandHandler("coord", getCoord) 
  

Edited by Guest

تيم سبيك بروجيمر

ts3server://ts.pg.sa

Posted

Well, first you must define 'thePlayer' in the function name, second you must define the x, y, z variables, like this:

local x, y, z = getElementPosition ( thePlayer ) 

And then output it to the player who used the command.

@UAEpro: You didn't define 'thePlayer', also, is outputChatBox, not outputChatbox.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Well, first you must define 'thePlayer' in the function name, second you must define the x, y, z variables, like this:
local x, y, z = getElementPosition ( thePlayer ) 

And then output it to the player who used the command.

@UAEpro: You didn't define 'thePlayer', also, is outputChatBox, not outputChatbox.

thanks .. i just fixed it to show the position without looking to the function xD my fault

تيم سبيك بروجيمر

ts3server://ts.pg.sa

Posted

Ah, I noticed I forgot the capital since it wasn't outputting anything at all. And wow. Thank you all! The script just makes so much sense now.

Discord: its.tails

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...