Vehicle.GetAddon

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

This function returns the add-on attached to a vehicle. List of add-on IDs can be found from here. If the vehicle has no add-on, VEHADDON_NONE will be returned.

Syntax

  1. int Vehicle.GetAddon()

Arguments

  • none

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "vehaddon" )
  5. {
  6. if ( player.Vehicle )
  7. {
  8. local addon = player.Vehicle.GetAddon();
  9. MessagePlayer( "This vehicle currently has addon: " + addon, player );
  10. }
  11. }
  12. }
  13.  

This command will return what addon the the player's vehicle has.

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