Squirrel/Server/Functions/Vehicles/IdleRespawnTime

From Liberty Unleashed Wiki
Revision as of 14:41, 8 March 2010 by Force (Talk | contribs)

Jump to: navigation, search

This Vehicle class member returns or sets the idle respawn time of the given vehicle. 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

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

This command will return the idle respawn time of the vehicle they are driving.

Example 2. Setting

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

This command will set the idle respawn time of the vehicle they are driving to 5 minutes.

Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox