SetVehiclePos
Description:
Function SetVehiclePos set a vehicle's position.
An empty vehicle will not fall after being teleported into the air. |
Parameters:
(vehicleid, Float:x, Float:y, Float:z)
int | vehicleid | Vehicle ID that you want set new position. |
float | X | The X coordinate to position the vehicle at. |
float | Y | The Y coordinate to position the vehicle at. |
float | Z | The Z coordinate to position the vehicle at. |
Return Values:
- 1: The function was executed successfully.
- 0: The function failed to execute. The vehicle specified does not exist.
Examples:
// Put the player's vehicle at the coordinates 0, 0, 3 (center of SA) new vehicleid = GetPlayerVehicleID(playerid); SetVehiclePos(vehicleid, 0, 0, 3);
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- SetPlayerPos: Set a player's position.
- GetVehiclePos: Get the position of a vehicle.
- SetVehicleZAngle: Set the direction of a vehicle.