papam77 Posted July 20, 2013 Share Posted July 20, 2013 Hello how can make moving ped if is it possible i need to move him from XYZ to XYZ and then back to first XYZ Link to comment
DiSaMe Posted July 20, 2013 Share Posted July 20, 2013 setPedControlState setPedCameraRotation Link to comment
papam77 Posted July 20, 2013 Author Share Posted July 20, 2013 --------------------------------- -- DeeJay v2 -------------------- --------------------------------- function funkce () --------------------------------- -- Pedové ----------------------- --------------------------------- setPedCameraRotation ( John, 130.791931 ) setPedControlState ( John, forwards, true ) --------------------------------- -- Outputy ---------------------- --------------------------------- outputChatBox ("EAG|#ffffffDeeJay: #ff9900Hello guys", 255,255,255, true ) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), funkce ) Ped name = John But why he isn't moving? Link to comment
DiSaMe Posted July 20, 2013 Share Posted July 20, 2013 Maybe because you use an undefined variable (forwards) rather than a string ("forwards") in setPedControlState? Link to comment
papam77 Posted July 20, 2013 Author Share Posted July 20, 2013 --------------------------------- -- DeeJay v2 -------------------- --------------------------------- function funkce () --------------------------------- -- Pedové ----------------------- --------------------------------- setPedCameraRotation ( John, 130.791931 ) setPedControlState ( John, "forwards", true ) --------------------------------- -- Outputy ---------------------- --------------------------------- outputChatBox ("EAG|#ffffffDeeJay: #ff9900Hello guys", 255,255,255, true ) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), funkce ) And doesn't work. Link to comment
DiSaMe Posted July 20, 2013 Share Posted July 20, 2013 Another reason is because the variable John is not defined. If you want to get the element from ID, use this function: getElementByID Link to comment
papam77 Posted July 20, 2013 Author Share Posted July 20, 2013 So local John = getElementByID("John") ? Link to comment
papam77 Posted July 20, 2013 Author Share Posted July 20, 2013 local John = getElementByID("John") setPedCameraRotation ( "John", 130.791931 ) setPedControlState ( "John", "forwards", true ) now i have this and doesn't work. Link to comment
CocaColaBear Posted July 20, 2013 Share Posted July 20, 2013 local John = getElementByID("John") setPedCameraRotation (John, 130.791931 ) setPedControlState (John, "forwards", true ) Use this Link to comment
papam77 Posted July 20, 2013 Author Share Posted July 20, 2013 Doesn't work, ped is still on same place. Link to comment
denny199 Posted July 20, 2013 Share Posted July 20, 2013 script your own ped instead, also if you are testing in editor put it then in dimension 200. 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