- Documentation
- Shared functions
- getVehicleUpgradeOnSlot
Function
getVehicleUpgradeOnSlot
Returns the ID of the part fitted in the given tuning slot, or 0 when the slot is empty. Slot numbers 0-16 are described by getVehicleUpgradeSlotName.
Syntax
int getVehicleUpgradeOnSlot(vehicle vehicle, int slot)Arguments
vehiclevehicle- The vehicle.
slotint- Slot number 0-16 (e.g. 2 spoiler, 8 nitro, 12 wheels, 13 exhaust).
Returns
Part ID or 0.
Example
addCommandHandler("manitro", function(player)
local vehicle = getPedOccupiedVehicle(player)
if vehicle and getVehicleUpgradeOnSlot(vehicle, 8) ~= 0 then
outputChatBox("To auto ma nitro.", player)
end
end)
See also
getVehicleUpgradesReturns the IDs of all tuning parts fitted to a vehicle. Works on both sides.getVehicleUpgradeSlotNameReturns the English name of a tuning slot, given a slot number or a part ID. Slots: 0 Hood, 1 Vent, 2 Spoiler, 3 Sideskirt, 4 Front Bullbars, 5 Rear Bullbars, 6 Headlights, 7 Roof, 8 Nitro, 9 Hydraulics, 10 Stereo, 11 Unknown, 12 Wheels, 13 Exhaust, 14 Front Bumper, 15 Rear Bumper, 16 Misc.