MoveObject

From SA-MP Wiki

Jump to: navigation, search

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.


Parameters:
(objectid, Float:X, Float:Y, Float:Z, Float:Speed)
objectidThe objectid you want to move.
Float:XThe new X coordinate.
Float:YThe new Y coordinate.
Float:ZThe new Z coordinate.
Float:SpeedThe 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.

  • 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.

Personal tools