MoveObject

From SA-MP Wiki

Revision as of 19:30, 25 October 2009; view current revision
←Older revision | Newer revision→
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).

new obj; // Somewhere at the top of your script
public OnGameModeInit()
{
    obj = CreateObject(980, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    return 1;
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    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.



Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.

Personal tools