Force Liveries on car Spawn

Hello all.
I added some cars that have different liveries on spawn, but i want to spawn only one livery.

EX: I have a car that is medic, he has different colour: yellow, red, white with “paramedic” stripe and others.

How can i spawn every time one of them?

Hello, you have two natives to do that :

SetVehicleMod(vehicle, 48, livery)
SetVehicleLivery(vehicle, livery)

https://runtime.fivem.net/doc/natives/#_0x6AF0636DDEDCB6DD
https://runtime.fivem.net/doc/natives/#_0x60BF608F1B8CD1B6

Second native only works with certain vehicles.

For example, a sanchez skin is set with SetVehicleMod.
The polmav skin is set with SetVehicleLivery.

If you had done a little research in existing resources, you could easily find the solution.

:wink:

4 Likes

Forgot to specify i’m on a server, so i stream that add-on.

How can i set only one livery spawn?

Another thing is that some cars spawn with Policelight someone not, how can I set that all spawn with policelight?

Remove others livery in the ytd file(s) ?
Only client can specify “the livery”. Generally, the liveries names ended by xxxxx_sign_1.
“_1” is the “0” livery. If you remove other, every times, the vehicle spawn with the only available livery.

That was what i thought, how about the Police Light? How can i make that spawn everytime?

Some models do not allow it. In this case it is necessary to edit the model directly. Is not a “livery” but something like a variant.

In the model is set on “extra_1”, is there a way to force the permanent extra_1?

I d’ont know… The only time I tried to change the model, I broke everything … :laughing:
I’m not a model specialist :sweat_smile:

I think i have to change the car then, so sad, thanks for the help!

1 Like

Glad to help you :wink:

I’m thinking that somewhere there must be someone that says “spawn car with extra 1 or extra2” (one is normal siren, one is occultated siren). The questione is, where?

1 Like

Found it.

On vehicles.meta you just have to add * FLAG_EXTRAS_ALL

Ok, interesting.
This flag add systematically the “extra” when the car spawn ?

1 Like

Yes.
It adds all extras available for the car every time.
If you want to spawn only some, you have to USE FLAG_EXTRAS_REQUIRE and specify which extras are required

1 Like

Ok ! Thanks ! Finally, you helped me ! :joy:
Theses infos was here : https://forums.gta5-mods.com/topic/19786/tutorial-how-to-make-specific-vehicle-extras-appear-on-a-vehicle-every-spawn

Yes, after 3h of research i found that topic.

1 Like

Hi bro, can you help me pls? I’m trying to make one job and when you spawn the car the car spawn all skins (the car is one burrito). I tried to use the first code (SetVehicleMod(vehicle, 48, livery)) but the car still spwaning all skins

you’re welcome

1 Like

Force Livery’s when they are spawned!