Squirrel/Server/Functions/Vehicles/GetAddon

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

Jump to: navigation, search

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