Vehicle.EngineDamage

From Liberty Unleashed Wiki
Revision as of 15:04, 7 July 2011 by Thijn (Talk | contribs)

Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events


This EngineDamage class member returns or sets the level of engine damage (0 - 150; 0 = undamaged engine; 250 = engine is burning)

Syntax

You can either return or set the value using this member:

  1. int Vehicle.EngineDamage
  1. Vehicle.EngineDamage = int iDmg

Arguments

  • iDmg = 0 - 150; 0 = undamaged engine; 250 = engine is burning and car will crash

Example 1. returning

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "getenginedamage" )
  5. {
  6. if ( player.Vehicle ) MessagePlayer( "Vehicle's engine damage: " + player.Vehicle.EngineDamage, player );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The functions Player.Vehicle, MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.

Example 2. Setting value

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "setenginedamage" )
  5. {
  6. if ( player.Vehicle )
  7. {
  8. player.Vehicle.EngineDamage = 250;
  9. MessagePlayer( "Attention ! Vehicle's engine is burning !", player );
  10. }
  11.  
  12. }
  13. return 1;
  14. }
  15.  

Notes

The functions Player.Vehicle, MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.


Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox