How can I spawn vehicles with full engine, armor, turbo etc upgrade?

I cannot spawn the police vehicle (which I cannot buy and upgarde) with full max out upgardes. What can I do to spawn the vehicle fully upgrade??

You can use SET_VEHICLE_MOD to set the upgrades after spawning the vehicles.

1 Like

In which file do i have to use it. server or client.
And can u send the format??

It would have to go in the file where the vehicle is spawned.
The syntax is explained in the link I posted.

If you are not comfortable with editing scripts, I suggest you reach out to the author of the script you are using and suggest it as a feature addition to that script.

Can u send me the format??/

1 Like

Again, the syntax is explained in the documentation I linked.
Is that what you mean with “the format”? If not, please explain what you are asking for.

SetVehicleMod(
vehicle --[[ Vehicle ]],
modType --[[ integer ]],
modIndex --[[ integer ]],
customTires --[[ boolean ]]
)

This is the format right so how do I insert or put the value So that my car will spawn fully upgraded… What is the maximum value for full upgrade I want to know that

To get the highest possible modIndex, you can use GetNumVehicleMods(vehicle, modType) - 1

It is not helping.

Share your code, and I’ll take a look at it.

function SetVehicleMaxMods(vehicle)
    local props = {
      modEngine       = true,
      modBrakes       = true,
      modArmor        = 6,
      modTransmission = true,
      modSuspension   = true,
      modTurbo        = true
    }
  
   EXICore.Functions.SetVehicleProperties(vehicle, props)
  end
SetVehicleMaxMods(veh)
function SetVehicleMaxMods(vehicle)
    local props = {
      modEngine       = true,
      modBrakes       = true,
      modArmor        = 6,
      modTransmission = true,
      modSuspension   = true,
      modTurbo        = true
    }
  EXICore.Functions.SetVehicleProperties(vehicle, props)
  end

I have used this code but it only gives turbo to the vehicle but it does not do anything with the armor

I only need the armor of the vehicle to be full while I spawn the vehicle and I am not getting any clue how to use the vehicle natives setvehiclemod()

Yeah, I haven’t the foggiest idea what EXICore is or how it’s SetVehicleProperties works.
You’ll need to talk to the author/maintainer of that resource to sort out their syntax.

local performanceModIndices = {11,12,13,16}
function PerformanceUpgradeVehicle(vehicle, customWheels)
    customWheels = customWheels or false
    local max
    if DoesEntityExist(vehicle) and IsEntityAVehicle(vehicle) then
        for _, modType in ipairs(performanceModIndices) do
            max = GetNumVehicleMods(vehicle, modType) - 1
            SetVehicleMod(vehicle, modType, max, customWheels)
        end
        ToggleVehicleMod(vehicle, 18, true) -- Turbo
    end
end

For armor do I need to do same as above??

Armor is slot 16, so already included there.

It didn’t work for me. Where should paste that code ??
I pasted it on client folder (job.lua)

You can’t just paste it and have it work by magic.
It is an example of how you can achieve what you are trying to do. It is intended for you to read as a reference when you do the thing yourself.

Best of luck.