Engine Swapping

Doing an engine swap, involves creating a command or script to execute the export to set the vehicle engine. It is important to remember that C.H.A.S.E.R, will not save the swapped engine, 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 engine swap your car, create a lua resource and paste the following code: (Note: in order to swap back to the original engine, simply do "setengine stock")

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

RegisterCommand("setengine", function(source, args, rawCommand)
    if #args < 1 then
        print("Please insert an engine..")
        return
    end
    local engine = args[1]
    if chaser:chaser_getloadstatus() then
        chaser:chaser_setengine(engine)
        Citizen.Wait(50)
        chaser:chaser_refreshengine()
    end
end, false)

Last updated