SetActorPos

From SA-MP Wiki

Jump to: navigation, search

SetActorPos was added in SA-MP 0.3.7 This function was added in SA-MP 0.3.7 and will not work in earlier versions!


Description:

Set the position of an actor.


Parameters:
(actorid, Float:X, Float:Y, Float:Z)
actoridThe ID of the actor to set the position of. Returned by CreateActor.
XThe X coordinate to position the actor at.
YThe Y coordinate to position the actor at.
ZThe Z coordinate to position the actor at.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. The actor specified does not exist.


Image:32px-Ambox_warning_orange.png

Note

When creating an actor with CreateActor, you specify it's position. You do not need to use this function unless you want to change its position later.


new MyActor;
 
public OnGameModeInit()
{
    MyActor = CreateActor(...);
    return 1;
}
 
// Somewhere else
SetActorPos(MyActor, 1.0, 2.0, 3.0);

Related Functions

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

Personal tools
Navigation
Toolbox
In other languages