M MY Multiplayer: Wiki
Side
Kind

getVehicleUpgradeOnSlot

Shared

Returns the upgrade fitted on one slot of a vehicle.

string|false getVehicleUpgradeOnSlot(vehicle vehicle, string|int slot)

Parameters

NameTypeDescription
vehiclevehicleThe vehicle.
slotstring|intThe slot: its name (case does not matter) or its index, counted from 0 in the order of getVehicleUpgradeSlots. An unknown slot is an error.

Returns

The upgrade's model name, or false if the slot is empty.

Example

addCommandHandler("slots", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if not vehicle then return end
    for _, slot in ipairs(getVehicleUpgradeSlots()) do
        outputDebugString(slot .. ": " .. tostring(getVehicleUpgradeOnSlot(vehicle, slot)))
    end
end)
Coming from MTAMTA uses numeric upgrade ids (1000 to 1193). Here an upgrade is its model's name, and the slots are the ones the mounted packs declare.

See also