SetActorPos
From SA-MP Wiki
Description:
Set the position of an actor.
(actorid, Float:X, Float:Y, Float:Z)
actorid | The ID of the actor to set the position of. Returned by CreateActor. |
X | The X coordinate to position the actor at. |
Y | The Y coordinate to position the actor at. |
Z | The 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.
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.
- GetActorPos: Get the position of an actor.
- CreateActor: Create an actor (static NPC).