Squirrel/Server/Events/Vehicle/onVehicleRespawn
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This is called whenever a vehicle is respawned, for any reason EXCEPT respawn after explosion == Syntax == <code>function onVehicleRespawn( vehicle )</code> == Parameters == ...) |
|||
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|onVehicleRespawn}} | |
− | This is called whenever a vehicle is respawned | + | This is called whenever a vehicle is respawned. |
== Syntax == | == Syntax == | ||
− | <code>function onVehicleRespawn( vehicle )</code> | + | <code>function onVehicleRespawn( Vehicle vehicle )</code> |
− | == | + | === Arguments === |
− | * '''vehicle''' - The vehicle | + | * '''vehicle''' - The vehicle which respawned |
+ | |||
+ | === Returns === | ||
+ | |||
+ | This event does not handle return values. | ||
== Example == | == Example == | ||
− | This example will print a message to the console whenever a vehicle | + | This example will print a message to the console whenever a vehicle respawns. |
<code lang="squirrel"> | <code lang="squirrel"> | ||
function onVehicleRespawn( vehicle ) | function onVehicleRespawn( vehicle ) | ||
{ | { | ||
− | print( "Vehicle " + vehicle.ID | + | print( "Vehicle " + vehicle.ID + " has respawned." ); |
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> | ||
Line 23: | Line 29: | ||
=== Notes === | === Notes === | ||
− | The | + | The functions [[Squirrel/Server/Functions/Vehicles/ID|Vehicle.ID]] and [[Squirrel/Server/Functions/Misc/print|print]] were used in this example. More info about them can be found in the corresponding pages. |
== Related Events == | == Related Events == | ||
{{Squirrel/Server/Events/Vehicle}} | {{Squirrel/Server/Events/Vehicle}} |
Latest revision as of 13:14, 11 November 2010
This is called whenever a vehicle is respawned.
[edit] Syntax
function onVehicleRespawn( Vehicle vehicle )
[edit] Arguments
- vehicle - The vehicle which respawned
[edit] Returns
This event does not handle return values.
[edit] Example
This example will print a message to the console whenever a vehicle respawns.
function onVehicleRespawn( vehicle ) { print( "Vehicle " + vehicle.ID + " has respawned." ); return 1; }
[edit] Notes
The functions Vehicle.ID and print were used in this example. More info about them can be found in the corresponding pages.