Padul Posted June 27, 2016 Share 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? Link to comment
ma2med Posted June 27, 2016 Share Posted June 27, 2016 this is clientside or serverside? Link to comment
Walid Posted June 27, 2016 Share 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. Link to comment
Padul Posted June 28, 2016 Author Share Posted June 28, 2016 ok, its working ,thank you Link to comment
Tails Posted June 28, 2016 Share 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. 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