- Documentation
- Shared functions
- removeVehicleUpgrade
Function
removeVehicleUpgrade
Removes a fitted tuning part from a vehicle. Removing nitro also clears the stored nitro charges.
Syntax
bool removeVehicleUpgrade(vehicle vehicle, int upgrade)Arguments
vehiclevehicle- The vehicle.
upgradeint- ID of the part to remove.
Returns
true when the part was removed; false when it was not fitted.
Example
addCommandHandler("bezspojlera", function(player)
local vehicle = getPedOccupiedVehicle(player)
local part = vehicle and getVehicleUpgradeOnSlot(vehicle, 2)
if part and part ~= 0 then removeVehicleUpgrade(vehicle, part) end
end)
Notes
Client. In a client script for this player only.
See also
addVehicleUpgradeFits a tuning part to a vehicle (spoiler, wheels, exhaust, nitro, hydraulics, bumpers…), visible and working for every player. The part must fit the model (getVehicleCompatibleUpgradeslists them). If the same slot already had a part, it is replaced; fitting the same part again changes nothing. New parts added withengineRequestModelwork too.getVehicleUpgradesReturns the IDs of all tuning parts fitted to a vehicle. Works on both sides.