Jump to content

Is possible to make moving ped?


papam77

Recommended Posts

Posted
--------------------------------- 
-- 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?

Posted

Maybe because you use an undefined variable (forwards) rather than a string ("forwards") in setPedControlState?

Posted
--------------------------------- 
-- 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.png

And doesn't work.

Posted

Another reason is because the variable John is not defined. If you want to get the element from ID, use this function:

getElementByID 

Posted
local John = getElementByID("John") 
setPedCameraRotation ( "John", 130.791931 ) 
setPedControlState ( "John", "forwards", true ) 
  
  
  
  
  

now i have this and doesn't work.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...