SA-MP Forums Archive
How to move object back and forth? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to move object back and forth? (/showthread.php?tid=636585)



How to move object back and forth? - ax1 - 30.06.2017

let's say I want to move object back and forth, from point A to point B, then back to point A and then repeat everything for an infinite loop.
I can move object from point A to point B with MoveDynamicObject and then I guess I could use timer to move object from point B back to point A.
The problem is, how do I know how much time does it take to move an object from point A to point B? MoveDynamicObject doesnt allow me to set time period for object movement, just speed


Re: How to move object back and forth? - Vince - 30.06.2017

MoveDynamicObject itself returns the time in milliseconds that it would take to move the object over the specified distance at the specified speed. You can also use OnDynamicObjectMoved.


Re: How to move object back and forth? - ax1 - 30.06.2017

Quote:
Originally Posted by Vince
Посмотреть сообщение
MoveDynamicObject itself returns the time in milliseconds that it would take to move the object over the specified distance at the specified speed. You can also use OnDynamicObjectMoved.
thanks!