mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Add serverside objects move events

Open FileEX opened this issue 1 year ago • 3 comments

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

FileEX avatar May 01 '24 17:05 FileEX

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.

FileEX avatar May 02 '24 14:05 FileEX

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

TheNormalnij avatar May 11 '24 21:05 TheNormalnij

So how to improve it?

FileEX avatar May 12 '24 09:05 FileEX