Skip to main content

SetVehicleProperties

ESX.Game.SetVehicleProperties(vehicle, props)

This function sets various properties for an vehicle object.

Example

local playerPed = PlayerPedId()

if IsPedInAnyVehicle(playerPed, false) then
local vehicle = GetVehiclePedIsIn(playerPed, false)

ESX.Game.SetVehicleProperties(vehicle, {
plate = 'ESX',
modTurbo = true
})
end

Valid Table Content

ChildData TypeExplanation
modelnumberThe vehicle hash
platenumberVehicle plate, maximum 8 characters
plateIndexnumberPlate style
bodyHealthnumberBody health
engineHealthnumberEngine health
tankHealthnumberPetrol Tank health
fuelLevelnumberFuel level
dirtLevelnumberDirtiness level
color1numberPrimary color
color2numberSecondary color
pearlescentColornumberPearlescent color
wheelColornumberWheel color
wheelsnumberWheel type
windowTintnumber
neonEnabledtableTable with hardcoded four childs for left, back, front & back neons
neonColortablePacked table with three childs for r,g,b
extrastablePair table with id as index, and state as value
tyreSmokeColortablePacked table with three childs for r,g,b
modSpoilersnumber
modFrontBumpernumber
modRearBumpernumber
modSideSkirtnumber
modExhaustnumber
modFramenumber
modGrillenumber
modHoodnumber
modFendernumber
modRightFendernumber
modRoofnumber
modEnginenumber
modBrakesnumber
modTransmissionnumber
modHornsnumber
modSuspensionnumber
modArmornumber
modTurboboolean
modSmokeEnabledboolean
modXenonboolean
modFrontWheelsnumber
modBackWheelsnumber
modPlateHoldernumber
modVanityPlatenumber
modTrimAnumber
modOrnamentsnumber
modDashboardnumber
modDialnumber
modDoorSpeakernumber
modSeatsnumber
modSteeringWheelnumber
modShifterLeaversnumber
modAPlatenumber
modSpeakersnumber
modTrunknumber
modHydrolicnumber
modEngineBlocknumber
modAirFilternumber
modStrutsnumber
modArchCovernumber
modAerialsnumber
modTrimBnumber
modTanknumber
modWindowsnumber
modLiverynumber