setElementPosition | Multi Theft Auto: Wiki Skip to content

setElementPosition

Client-side
Server-side
Shared

Pair: getElementPosition

This function sets the position of an element to the specified coordinates.

Do not use this function to spawn a player. It will cause problems with other functions like warpPedIntoVehicle. Use spawnPlayer instead.

If you want to put a vehicle or player out of the water or simulate the position-resetting behaviour if CJ goes below the ground too far, then you need to retrieve a recommended coordinate on ground to place the element at. Take a look at this MTA forums post for steps in the right direction.