C0b0ll Posted August 15, 2014 Posted August 15, 2014 Hello everybody, I try to move a ped using setPedControlState. My problem is that the ped is only moving correctly for the syncer client. For the others, the ped doesn't play any animation and he is teleported each 2 meters... Here is my client code : function startForward(mtaPed) setPedControlState(mtaPed, "forwards", true) end addEvent("startForward", true) addEventHandler("startForward", getRootElement(), startForward) What is wrong ? Thanks for your help .
DiSaMe Posted August 15, 2014 Posted August 15, 2014 You're probably only triggering the event for syncer.
C0b0ll Posted August 15, 2014 Author Posted August 15, 2014 From the server side, i have to use triggerClientEvent for all clients ? Like this : triggerClientEvent(getRootElement(), "startForward", mtaPed, mtaPed)
DiSaMe Posted August 15, 2014 Posted August 15, 2014 If you need the server to start the movement of ped for everyone, then yes, you need to trigger the event for everyone. MTA does not sync control states, and that's why server does not have ped control state functions.
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