Weight Reduction

Doing a weight reduction, involves creating a command or script to execute the export to set the vehicle weight. It is important to remember that C.H.A.S.E.R, will not save the vehicle weight, and a independent saving/loading system should be made. Luckly, we already provide a functional demo for that, and it can be accessed here In order to create a command to set weight in your car, create a lua resource and paste the following code:

local chaser = exports['legacydmc_chaser'] -- the export HAS to be "legacydmc_chaser"

RegisterCommand("weightreduction", function(source, args, rawCommand)
    if #args < 1 then
        print("Please insert an weight..")
        return
    end
    local weightinkg = args[1]
    if chaser:chaser_getloadstatus() then
        chaser:chaser_setweight(weightinkg)
        --TriggerServerEvent('chaser:savemetadata',NetworkGetNetworkIdFromEntity(vehicle),'weight',weightinkg) -- simulating the save on the front end
        Citizen.Wait(50)
        chaser:chaser_refreshengine()
    end
end, false)

Last updated