Vehicle.IdleRespawnTime

From Liberty Unleashed Wiki
Revision as of 11:08, 11 October 2010 by VRocker (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 idle respawn time of the given vehicle as seconds. If the vehicle is unused longer than this time limit indicates, it will respawn.

Syntax

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

  1. int Vehicle.IdleRespawnTime
  1. Vehicle.IdleRespawnTime = int iTime

Arguments

  • iTime - This is the new idle respawn time for the vehicle

Example 1. Returning

This command will return the idle respawn time of the vehicle the player is driving.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "vehidlerespawntime" )
  5. {
  6. if ( player.Vehicle ) MessagePlayer( "Your vehicles idle respawn time is: " + player.Vehicle.IdleRespawnTime, player );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in the corresponding pages.

Example 2. Setting

This command will set the idle respawn time of the vehicle the player is driving to 5 minutes.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "setvehidle" )
  5. {
  6. if ( player.Vehicle ) player.Vehicle.IdleRespawnTime = 300;
  7. }
  8. return 1;
  9. }
  10.  

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox