RespawnVehicle

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function respawns a vehicle according to its set respawn position, set by setVehicleRespawnPosition or the position and rotation it was created on. To spawn a vehicle to a specific location just once, spawnVehicle can be used.

Syntax

bool respawnVehicle ( vehicle theVehicle )

OOP Syntax Help! I don't understand this!

Method: vehicle:respawn(...)


Required Arguments

  • theVehicle: The vehicle you wish to respawn

Returns

Returns true if the vehicle respawned successfully, false if the passed argument does not exist or is not a vehicle.

Example

This example makes an exploded vehicle re-spawn after 5 seconds.

function respawnExplodedVehicle()
	setTimer(respawnVehicle, 5000, 1, source)
end
addEventHandler("onVehicleExplode", root, respawnExplodedVehicle)

See Also