ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getVehicleUpgradeOnSlot

Function

getVehicleUpgradeOnSlot

Server and clientVehiclesIdentical to MTA:SA

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