Squirrel/Server/Functions/Vehicles/IdleRespawnTime

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
{{Squirrel/Title|Vehicle.RespawnTime}}
+
{{Squirrel/Title|Vehicle.IdleRespawnTime}}
 
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.
 
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.
  
Line 19: Line 19:
 
function onPlayerCommand( player, cmd, text )
 
function onPlayerCommand( player, cmd, text )
 
{
 
{
     if ( cmd == "vehrespawntime" )
+
     if ( cmd == "vehidlerespawntime" )
 
     {
 
     {
           if ( player.Vehicle ) MessagePlayer( "Your vehicles respawn time is: " + player.Vehicle.IdleRespawnTime, player );
+
           if ( player.Vehicle ) MessagePlayer( "Your vehicles idle respawn time is: " + player.Vehicle.IdleRespawnTime, player );
 
     }
 
     }
 
      
 
      

Latest revision as of 11:08, 11 October 2010

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.

[edit] Syntax

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

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

[edit] Arguments

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

[edit] 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.  

[edit] Notes

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

[edit] 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.  

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox