getVehicleRespawnPosition | Multi Theft Auto: Wiki Skip to content

getVehicleRespawnPosition

Client-side
Server-side
Shared

Pair: setVehicleRespawnPosition

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function retrieves the respawn coordinates of a vehicle.

OOP Syntax Help! I don't understand this!

  • Method:vehicle:getRespawnPosition(...)
  • Variable: .respawnPosition

Syntax

float float float getVehicleRespawnPosition ( vehicle theVehicle )
Required Arguments
  • theVehicle: The vehicle which you'd like to retrieve the respawn coordinates of.

Returns

  • float float float: value

Returns three floats indicating the respawn coordinates of the vehicle , x , y and z respectively.

Code Examples

shared
function getRespawnPosition(player)
local veh = getPedOccupiedVehicle(player)
if veh then
local x,y,z = getVehicleRespawnPosition(veh)
local rx,ry,rz = getVehicleRespawnRotation(veh)
outputChatBox("this car respawn in x = "..x.." y = "..y.." z = "..z.." rx = "..rx.." ry = "..rz,player,0,255,0)
else
outputChatBox("you are not in the car",player,255,0,0)
end
end
addCommandHandler("getRespawnPos",getRespawnPosition)

See Also

Vehicle Functions