AddVehicleUpgrade: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
This function adds an upgrade to an existing vehicle, eg: nos, hyrdraulics. Defined in San Andreas\data\maps\veh_mods\veh_mods.ide.
This function adds an upgrade to an existing vehicle, eg: nos, hyrdraulics. Defined in San Andreas\data\maps\veh_mods\veh_mods.ide.



Revision as of 23:42, 9 July 2006

This function adds an upgrade to an existing vehicle, eg: nos, hyrdraulics. Defined in San Andreas\data\maps\veh_mods\veh_mods.ide.

Syntax

bool addVehicleUpgrade ( vehicle theVehicle, upgrade )

Required Arguments

  • theVehicle: The element representing the vehicle you wish to add the upgrade to.
  • upgrade: The id of the upgrade you wish to add.

Returns

Returns 'true' if the upgrade was successfully added to the vehicle, otherwise 'false'.

Example

addEventHandler ( "onPlayerConsole", root, "onPlayerConsole" )
function onPlayerConsole ( text )
  command = split ( text, 1, 32 )
  if ( command == "nos" ) then
    vehicle = getPlayerOccupiedVehicle ( source )
    if ( vehicle ) then
      addVehicleUpgrade ( vehicle, 1010 ) -- nos-10x
    end
  end
end

See Also