Vehicle.SetAddon

From Liberty Unleashed Wiki
Revision as of 14:45, 10 August 2013 by Mido pop (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function attaches an add-on to the given vehicle. List of add-on IDs can be found from here. If you want to remove the add-on from the vehicle, set the add-on to VEHADDON_NONE.

Syntax

  1. bool Vehicle.SetAddon( int iAddonID )

Arguments

  • iAddonID - The ID of the vehicle addon

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "setvehaddon" )
  5. {
  6. if ( text )
  7. {
  8. local veh = FindVehicle( text.tointeger() );
  9. if ( veh ) veh.SetAddon( test );
  10. }
  11. }
  12. }
  13.  

This command will give the specified vehicle ID, addon In test.

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