I’m working on creating a menu with all vehicle livery options and I can’t figure out why this isn’t working
Code:
local playerPed = GetPlayerPed(-1)
local playerVeh = GetVehiclePedIsIn(playerPed, false)
local liveryCount = GetVehicleLiveryCount(playerVeh)
for i=1, liveryCount, 1 do
local realIndex = i - 1
local modName = GetLiveryName(playerVeh, realIndex)
local realModName = GetLabelText(modName)
Citizen.Trace("modname:realModName "..tostring(modName)..":"..tostring(realModName))
end
Result:
https://puu.sh/wmhIA/b8a001f97d.jpg
modname:realModName SANC_lV1:Sprunk Xtreme
modname:realModName nil:NULL
modname:realModName nil:NULL
modname:realModName nil:NULL
modname:realModName nil:NULL
I’m not sure what I’m doing wrong compared to Native DB.