Padul Posted June 27, 2016 Posted June 27, 2016 function forObjPosition ( thePlayer, command ) local padx,pady,padz = getElementPosition ( thePlayer ) outputConsole ( "{" .. padx .. "," .. pady .. "," .. padz .. "}," ) end addCommandHandler("mypos",forObjPosition) What had i done bad?
Walid Posted June 27, 2016 Posted June 27, 2016 Try this : -- server side function forObjPosition ( thePlayer, command ) if thePlayer and isElement(thePlayer) then local padx,pady,padz = getElementPosition(thePlayer) outputChatBox ("{" .. padx .. "," .. pady .. "," .. padz .. "}",thePlayer,0,255,0) end end addCommandHandler("mypos",forObjPosition) if you are trying to use this code client side just remove the argument thePlayer and replace it in your code with localPlayer.
Tails Posted June 28, 2016 Posted June 28, 2016 Nothing was wrong with your code. It was just outputting it to the console. There's really no need for "if thePlayer and isElement(thePlayer) then" with onCommandHandler.
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