Scripting/Squirrel/Events/Vehicle/onVehicleRespawn

From VC-MP Wiki

Jump to: navigation, search

This event is called when a vehicle is respawned due to it being idle long enough, or a vehicle is respawned using a script. Note: This event is not called when a vehicle respawns after exploding.

Syntax

function onVehicleRespawn( vehicle )

Parameters

  • vehicle - The object representing the vehicle which spawned

Example

This example output the console when a vehicle respawns.

function onVehicleRespawn( vehicle )
{
     print( "Vehicle " + vehicle.ID() + " has respawned." );
}

Notes

The function vehicle.ID was used in in this example. More info about it in the corresponding page.

Related Events

Personal tools
squirrel scripting