Squirrel/Server/Events/Vehicle/onVehicleRespawn

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(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:
__NOTOC__
+
{{Squirrel/Title|onVehicleRespawn}}
This is called whenever a vehicle is respawned, for any reason EXCEPT respawn after explosion
+
This is called whenever a vehicle is respawned.
  
 
== Syntax ==
 
== Syntax ==
  
<code>function onVehicleRespawn( vehicle )</code>
+
<code>function onVehicleRespawn( Vehicle vehicle )</code>
  
== Parameters ==
+
=== Arguments ===
  
* '''vehicle''' - The vehicle pointer
+
* '''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 is respawned
+
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() + " has respawned." );
+
     print( "Vehicle " + vehicle.ID + " has respawned." );
 +
   
 +
    return 1;
 
}
 
}
 
</code>
 
</code>
Line 23: Line 29:
 
=== Notes ===
 
=== Notes ===
  
The function [[Squirrel/Server/Functions/Vehicles/ID|vehicle.ID]] was used in in this example. More info about it can be found in the corresponding page.
+
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

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This is called whenever a vehicle is respawned.

[edit] Syntax

  1. 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.

  1.  
  2. function onVehicleRespawn( vehicle )
  3. {
  4. print( "Vehicle " + vehicle.ID + " has respawned." );
  5. return 1;
  6. }
  7.  

[edit] Notes

The functions Vehicle.ID and print were used in this example. More info about them can be found in the corresponding pages.

[edit] Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox