- Documentation
- Server functions
- getVehicleRespawnPosition
Function
getVehicleRespawnPosition
Returns the coordinates of the place where the vehicle appears when it respawns.
Syntax
float, float, float getVehicleRespawnPosition(vehicle vehicle)Arguments
vehiclevehicle- The vehicle.
Returns
Three numbers x, y, z, or false.
Example
addCommandHandler("gdzieparking", function(player)
local vehicle = getPedOccupiedVehicle(player)
if not vehicle then return end
local x, y, z = getVehicleRespawnPosition(vehicle)
outputChatBox(("Parking: %.1f, %.1f, %.1f"):format(x, y, z), player)
end)
See also
setVehicleRespawnPositionSets the place (and optionally the rotation) where the vehicle appears when it respawns: after destruction, after being abandoned and onrespawnVehicle. By default it is where the vehicle was created. The vehicle is not moved right away.getVehicleRespawnRotationReturns the rotation the vehicle will have when it respawns.