mtasa-blue
mtasa-blue copied to clipboard
Add serverside objects move events
We have onClientObjectMoveStart and onClientObjectMoveStop events - This PR adds these events also for the server side.
The stoppedByScript parameter determines whether the object has been stopped using stopObject or has reached its destination
I had to change the way the onObjectStop event was triggered. This must be synchronized via a packet on the client side because on the server side StopMovement is not called when the object reaches its destination as this happens on the client side.
I also added the stoppedByScript parameter for the onClientObjectMoveStop event on the client side.
A packet from a client to notify server about this event is overkill. onObjectMoveStart and onObjectMoveStop are pointless on server, because server has full control over created objects in scripts, and setTimer replaces onObjectMoveStop. This realization still request setTimer, because onObjectMoveStop doesn't work on empty server. This can cause frustrating behavior and strange bugs in server scripts
So how to improve it?