Squirrel/Server/Functions/Vehicles/GetAddon

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|Vehicle.GetAddon}}
 
This function returns the add-on attached to a vehicle. List of add-on IDs can be found from [[Squirrel/Server/Constants#Vehicle_Addons|here]]. If the vehicle has no add-on, VEHADDON_NONE will be returned.
 
This function returns the add-on attached to a vehicle. List of add-on IDs can be found from [[Squirrel/Server/Constants#Vehicle_Addons|here]]. If the vehicle has no add-on, VEHADDON_NONE will be returned.
  

Latest revision as of 11:07, 11 October 2010

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.

[edit] Syntax

  1. int Vehicle.GetAddon()

[edit] Arguments

  • none

[edit] 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.

[edit] Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox