Custom mod vehicle

Hello, i’m working on a server and i want to add some mod on the police vehicle, so i made this code but the engine don’t want to be set

SetVehicleMod(policeveh, 11, 4)
ToggleVehicleMod(policeveh, 18, true)

the turbo is on

can you please help me?

ToggleVehicleMod(policeveh, 18, true)

That should definitely work for the turbo, provided policeveh is in fact the vehicle entity.

SetVehicleMod(policeveh, 11, 4, false)

That should work for the engine upgrade. You were missing the false at the end for bCustomTires which for some natives, doesn’t matter. If it is nil, it still works. But I think it does matter for this one. So chuck a false on the end and you should be golden. If that doesn’t work the only thing I could I think of, is that the vehicle you are using doesn’t have 4 engine upgrades. They are numbered starting at 0 for stock, so try 3, then 2, then 1 and see if it installs any engine mod at all. If you get it working, be sure to mark this post as solved. Good luck! :spades:

1 Like

Hello, so i test and the engine doesn’t work, i test with 1,2,3,4,5
so i don’t know how to made this work

i test the code with 5 vehicle but it still doesn’t work

Probably 1 of 2 things.
The policeveh variable is not actually the right entity.
Can you do other stuff with it? Toggling the turbo on and off works, right? If so, it’s the right entity.
If not, then it’s probably not.

Or option 2, it doesn’t support engine upgrades. What vehicle model is it? A base game model or a custom model? Have you checked the vehicle metadata to make sure that it has engine mods? Not all custom vehicles have engine mods.

option 1: i can remove the turbo if i want

option 2: the car is police3 and police2

base game car

As far as I am aware (pretty sure this is true on my server too), police, police2, police3, etc DO NOT have engine mods. They are not tunable. So that is why. They can have a turbo, like most vehicles. But no engine, susp, trans, etc.

Again, check the vehicle metadata to confirm. But 90% sure there are no upgrades for these vehicles except turbo.

ho ok i didn’t know, thanks you