Jump to content

can i make an coordinate schorter


Recommended Posts

hi, i am an lua noobie and i am trying to learn so...

here's a question:

i have this command you see (its made by myself)

  
function displayPlayerCoordinates(thePlayer, command) 
    local x,y,z = getElementPosition(thePlayer)  
    outputChatBox("your coordinates:".. x ..",".. y ..","..z, thePlayer) 
end 
  
addCommandHandler("pos", displayPlayerCoordinates) 
  

but when i type the command ingame it works perfectly, but it only shows coordinates that is a big float.

now my question is: how can i make my command so that is dispays the float shorter like this:

  
your coordinates: 567.12,542.89,8457.12 
  

instead of

  
your coordinates: 567.1232385 ,542.898776, 8457.1296396 
  

regards prolol1337

i hope you ca help me out

Link to comment

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...