RemoveVehicleUpgrade

From Multi Theft Auto: Wiki
Revision as of 16:44, 11 June 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Description

This function removes an already existing upgrade from the specified vehicle, eg: nos, hyrdraulics. Defined in San Andreas\data\maps\veh_mods\veh_mods.ide.

Syntax

bool removeVehicleUpgrade ( vehicle, upgrade )

Required Arguments

  • vehicle: The element representing the vehicle you wish to remove the upgrade from
  • upgrade: The upgrade you wish to remove, currently limited to NOS-5X(1008), NOS-2X(1009), NOS-10X(1010), HYDRAULICS(1087)

Returns

Returns 'true' if the upgrade was successfully removed from 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
      removeVehicleUpgrade ( vehicle, 1010 )
    end
  end
end

See Also