MovePlayerObject

From SA-MP Wiki

Jump to: navigation, search


Description:

Move an object with a set speed. Also supports rotation. Players/vehicles will surf moving objects.


Parameters:
(playerid, objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0)
playeridThe ID of the player whose player-object to move.
objectidThe ID of the object to move.
Float:XThe X coordinate to move the object to.
Float:YThe Y coordinate to move the object to.
Float:ZThe Z coordinate to move the object to.
Float:SpeedThe speed at which to move the object.
Float:RotXThe final X rotation (optional).
Float:RotYThe final Y rotation (optional).
Float:RotZThe final Z rotation (optional).


Return Values:

The time it will take for the object to move in milliseconds.


Image:32px-Ambox_warning_orange.png

Note

For movement distance, One unit = 1.0 object travel distance.


Image:32px-Ambox_warning_orange.png

Notes

  • If using the rotation parameters, the object must be moved (X/Y/Z). The object will interpolate the rotation from when the objects starts moving and when it stops.
  • The parameters below are for 0.3d R2 and older versions and should be ignored if you run the latest version of SA-MP.


Parameters:
(playerid, objectid, Float:X, Float:Y, Float:Z, Float:Speed)
playeridThe player you associated this object to.
objectidThe objectid you want to move.
Float:XThe new X coordinate.
Float:YThe new Y coordinate.
Float:ZThe new Z coordinate.
Float:SpeedThe speed at which to move the object.


MovePlayerObject(playerid, objectid, 2001.195679, 1547.113892, 10);

Related Functions

The following functions may be useful, as they are related to this function in one way or another.


Personal tools
In other languages