tim260 Posted February 22, 2012 Share Posted February 22, 2012 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
Castillo Posted February 22, 2012 Share Posted February 22, 2012 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 ) Link to comment
tim260 Posted February 22, 2012 Author Share Posted February 22, 2012 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
Kenix Posted February 22, 2012 Share Posted February 22, 2012 In the rest of the functions you need convert value to string( tostring function ). http://bugs.mtasa.com/view.php?id=6021 Link to comment
Castillo Posted February 22, 2012 Share Posted February 22, 2012 Not anymore, you can now do like: outputChatBox(500) No need to convert number to string anymore. Link to comment
Kenix Posted February 22, 2012 Share Posted February 22, 2012 Yes i said in function outputChatBox convert value to string. But if you use guiCreateLabel and etc you need convert. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now