tim260 Posted February 22, 2012 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)
Castillo Posted February 22, 2012 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
tim260 Posted February 22, 2012 Author 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
Castillo Posted February 22, 2012 Posted February 22, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Kenix Posted February 22, 2012 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 http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Castillo Posted February 22, 2012 Posted February 22, 2012 Not anymore, you can now do like: outputChatBox(500) No need to convert number to string anymore. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Kenix Posted February 22, 2012 Posted February 22, 2012 Yes i said in function outputChatBox convert value to string. But if you use guiCreateLabel and etc you need convert. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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