Vehicle.RespawnTime

From Liberty Unleashed Wiki
Revision as of 17:44, 25 October 2010 by Force (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events


This Vehicle class member returns or sets the respawn time of the given vehicle.

Syntax

You can either return or set a new value using this member:

  1. Integer vehicle.RespawnTime
  1. vehicle.RespawnTime = integer iRespawnTime

Arguments

  • iRespawnTime - This is the new respawn time for the vehicle as a Integer in milliseconds.

Example 1. Returning

This will returning the found vehicle's respawn time when '/rtime' is typed.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "rtime" )
  5. {
  6. local pVehicle = FindVehicle( 0 );
  7. if ( pVehicle )
  8. {
  9. MessagePlayer( "Vehicle ID 0's respawn time - " + pVehicle.RespawnTime, pPlayer );
  10. }
  11. }
  12. return 1;
  13. }
  14.  

Example 2. Setting

This will set the found vehicle's respawn time to 10 seconds when a player types '/rtime2'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "rtime2" )
  5. {
  6. local pVehicle = FindVehicle( 0 );
  7. if ( pVehicle )
  8. {
  9. pVehicle.RespawnTime = 10;
  10. }
  11. }
  12. return 1;
  13. }
  14.  

Notes

The functions MessagePlayer and FindVehicle and event onPlayerCommand were used in these examples. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox