M MY Multiplayer: Wiki
Side
Kind

removeVehicleUpgrade

Shared

Takes a tuning upgrade off a vehicle.

bool removeVehicleUpgrade(element vehicle, string upgrade)

Parameters

NameTypeDescription
vehicleelementThe vehicle, or a parent element whose vehicles all lose the upgrade.
upgradestringThe upgrade's model name (case does not matter).

Returns

true if it was removed. false if that upgrade is not fitted on the vehicle or the element is not a vehicle.

Given a parent element such as root, it applies to every vehicle below it, but the value returned is the element's own: false when it is not a vehicle.

Example

addCommandHandler("destunar", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if not vehicle then return end
    for _, upgrade in ipairs(getVehicleUpgrades(vehicle)) do
        removeVehicleUpgrade(vehicle, upgrade)
    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