Vehicle.EngineDamage

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events


This EngineDamage class member returns or sets engine damage level

Syntax

You can return or set the value using this member:

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

Arguments

  • iDmg = engine damage level, max. value is 250

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