getVehicleUpgradeSlotName | Multi Theft Auto: Wiki Skip to content

getVehicleUpgradeSlotName

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function returns the name of an upgrade slot name (e.g. roof, spoiler).

Syntax

string getVehicleUpgradeSlotName ( int slot/upgrade )
Required Arguments
  • slot/upgrade: the slot ID or corresponding upgrade ID of which you want the name. 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

Returns

  • string: value

Returns a string with the slot name if a valid slot or upgrade ID was given, false otherwise.

Code Examples

shared

This example prints the name and upgrades on each slot of an entered vehicle to the chat.

function scriptOnPlayerEnterVehicle ( theVehicle, seat, jacked )
local upgrades = getVehicleUpgrades ( theVehicle )
for _, upgrade in ipairs ( upgrades ) do
outputChatBox ( getVehicleUpgradeSlotName ( upgrade ) .. ": " .. upgrade )
end
end
addEventHandler ( "onPlayerVehicleEnter", root, scriptOnPlayerEnterVehicle )

See Also

Vehicle Functions