MoveObject
From SA-MP Wiki
MoveObject
This function can be used to move an object in an animated (slow) way. If you let the object move slowly you can move the players on/under/in the object with it.
(objectid, Float:X, Float:Y, Float:Z, Float:Speed)
| objectid | The objectid you want to move. |
| Float:X | The new X coordinate. |
| Float:Y | The new Y coordinate. |
| Float:Z | The new Z coordinate. |
| Float:Speed | The speed of which the object will be moved with. |
Returns the time it will take for the object to move (in milliseconds).
public OnGameModeInit() { new obj; obj = CreateObject(980,0,0,0,0,0,0); return 1; } public OnPlayerCommandText() { if(strcmp(cmdtext, "/moveobject", true) == 0) { MoveObject(obj, 0, 0, 10, 2.00 ); return 1; } return 0; }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- CreateObject: Creates an object.
- StopObject: Stops a moving object.
- SetObjectPos: Immediately sets a new position without animation.
Related Callbacks
The following Callbacks might be useful, as they're related to this function in one way or another.
- OnObjectMoved: Called when an object is moved
