Jump to content

help on coords


tim260

Recommended Posts

im trying to output the position in the chatbox so i can copy it easy.

function coords() 
local x, y, z = getElementPosition( player ) 
-- attach the samsite to the elegy; 
outputChatBox ( "  ".. x .." ,  ".. y .." ,  ".. z .." " ) 
end 
addCommandHandler ( "coords", coords ) 

doesnt work !

[2012-02-22 22:47:47] WARNING: [gameplay]\restrictcars\coords.lua:2: Bad argument @ 'getElementPosition' 
[2012-02-22 22:47:47] ERROR: [gameplay]\restrictcars\coords.lua:4: attempt to concatenate local 'z' (a nil value) 
  

Link to comment
function coords(player) -- You forgot to put 'player' here  too. 
local x, y, z = getElementPosition( player ) 
-- attach the samsite to the elegy; 
outputChatBox ( "  ".. x .." ,  ".. y .." ,  ".. z .." " ) 
end 
addCommandHandler ( "coords", coords ) 

ty and you see its copied from the wiki example "-- attach the samsite to the elegy;" haha

so it works

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