[SOLVED] Livery not found

Hi all,

I’ve been trying for so long now to look for any help on this, but I’ve come here in the hopes that anyone knows the solution before I just give up completely.

So I’m working on a resource using the Conada Heli. The livery exists here:
"\Grand Theft Auto V\update\x64\dlcpacks\mpsum2\dlc.rpf\x64\levels\mpsum2\vehiclemods\conada_mods.rpf", and is called “conada_livery_3.yft”. (There’s also a Weasel News and Ron livery that would be cool to use)

I’ve done the basics:

  • Setting correct gamebuild, 3095 (which should include everything up to this point if I understand correctly)
  • Tried GetVehicleMod, (48 for VMT_LIVERY_MOD) (returns -1 or something)
  • Tried normal liveries GetVehicleLiveryCount (returns -1)
  • Downloading vehiclemeta (Criminal Enterprise DLC - Vehicle Meta Files)
  • Clearing caches (both client and server) a bunch of times

For whatever reason, no matter what I do, I can’t seem to get the Conada helicopter to spawn in with the right livery. (modelName “conada_livery_3”, of type “VMT_LIVERY_MOD”).

If anyone would be willing to take up the challenge by trying to spawn in that livery and tell me how they did it, I’d be most grateful. Once I’m done with a working script, I’ll be uploading it on Github for everyone to use.

Thank you in advance,
Cype.

Prolly cause setting the livery uses an index, not a string.
I’m just going to assume that the index in this case would be 10.

Try something like this;

local vehicleName = "conada"
local liveryIndex = 10

-- Spawn the vehicle
Citizen.CreateThread(function()
    RequestModel(vehicleName)
    while not HasModelLoaded(vehicleName) do
        Wait(500)
    end
    local vehicle = CreateVehicle(vehicleName, x, y, z, heading, true, false)
    
    -- Set the livery
    SetVehicleLivery(vehicle, liveryIndex)
end) 

Hi Lorenc. Thanks for taking the time out of your day to reply ^^

That sadly did not work. When calling “GetVehicleLiveryCount(vehicle)”, it returns -1. And that’s both when I modify the conada’s vehicle.meta to have the “FLAG_HAS_LIVERY” flag, and without.

It also does seem that it’s not a typical livery, but rather one that’s set using vehiclemods. So using SetVehicleLivery as you mentioned, won’t do the trick. (If only it was so easy, huh? :sweat_smile:) However when I run GetNumVehicleMods(vehicle, id), with that id being either 48 or 34 (I’ve seen both used, weirdly enough, though the official docs say that “VMT_LIVERY_MOD” is 48), it still reports 0 as well, indicating it doesn’t exist, though it does. Super strange.

So yeah, I’m stomped! I do really appreciate your input, and should you get the time to try running some code yourself as well, I’d love to see if you can “beat this challenge”, so to speak :stuck_out_tongue:

What the carcols.meta file mentions:

    <Item>
      <kitName>509_conada_modkit</kitName>
      <id value="509"/>
      <kitType>MKT_SPECIAL</kitType>
      <visibleMods>
        ...
        <Item>
          <modelName>conada_livery_10</modelName>
          <modShopLabel>CONADA_LIV10</modShopLabel>
          <linkedModels/>
          <turnOffBones/>
          <type>VMT_LIVERY_MOD</type>
          <bone>chassis</bone>
          <collisionBone>chassis</collisionBone>
          <cameraPos>VMCP_DEFAULT</cameraPos>
          <audioApply value="1.000000"/>
          <weight value="20"/>
          <turnOffExtra value="false"/>
          <disableBonnetCamera value="false"/>
          <allowBonnetSlide value="true"/>
        </Item>
      </visibleMods>
      ...
      <slotNames/>
      <liveryNames/>
    </Item>

It’s either trying to get it to show up via the vehiclemod-options, or trying to just make a clone of the conada with each skin available as a proper non-vehiclemod option. However I’ve got nooo idea how to do that.

UPDATE: vMenu does find the correct livery, but the code is made in C# and it isn’t directly clear to me by glancing over the code, what exactly causes the error when the same thing is attempted in Lua.

I solved the riddle!

Turns out that I overlooked a really important thing in the docs for SetVehicleModKit:

-- SET_VEHICLE_MOD_KIT
SetVehicleModKit(
	vehicle --[[ Vehicle ]], 
	modKit --[[ integer ]]
)

Set modKit to 0 if you plan to call SET_VEHICLE_MOD. That’s what the game does. Most body modifications through SET_VEHICLE_MOD will not take effect until this is set to 0.

Doh! So for everyone else looking to get liveries from modkits set using VMT_LIVERY_MOD, make sure you actually do SetVehicleModKit(vehicle, 0) first!

Case closed! :smile:

1 Like

I’m glad you found out what the issue was!
Yes before modding vehicles set the modkit its quite crucial.

I did not want to serve it on a plate cause researching yourself promises a better output in the longrun!

Though if you have further questions feel free to reach out!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.