- Documentation
- Shared functions
- getVehicleUpgrades
Function
getVehicleUpgrades
Returns the IDs of all tuning parts fitted to a vehicle. Works on both sides.
Syntax
table getVehicleUpgrades(vehicle vehicle)Arguments
vehiclevehicle- The vehicle.
Returns
An array of part IDs (empty when there is no tuning).
Example
addCommandHandler("czesci", function(player)
local vehicle = getPedOccupiedVehicle(player)
if not vehicle then return end
for _, part in ipairs(getVehicleUpgrades(vehicle)) do
outputChatBox(part .. " (" .. getVehicleUpgradeSlotName(part) .. ")", player)
end
end)
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.getVehicleUpgradeOnSlotReturns the ID of the part fitted in the given tuning slot, or 0 when the slot is empty. Slot numbers 0-16 are described bygetVehicleUpgradeSlotName.