Skip to content

Latest commit

 

History

History
93 lines (79 loc) · 4.63 KB

README.md

File metadata and controls

93 lines (79 loc) · 4.63 KB

MSK EngineToggle

[ESX/QBCore] Vehicle EngineToggle On/Off

GitHub release (latest by date)

Forum: https://forum.cfx.re/t/msk-enginetoggle-toggle-engine-on-off/4793840

Discord Support: https://discord.gg/5hHSBRHvJE

Description

  • The engine keeps running if you leave the vehicle without turning the engine off.
  • You can set that the engine starts automatically when entering a vehicle.
  • You can set a Command and Hotkey (RegisterKeyMapping).
  • Set your own Notification and Progressbar.
  • If you set Config.VehicleKeys to true then only the Owner of the Vehicle or someone with a Key can start the Engine!
  • Admin Command to start/stop the engine without a Key (Bypass)
  • Whitelist for models and plates that do not need a Key to start/stop the engine
  • Save the Angel of the Steering Wheel (Synced)
  • Hotwire Function in compatibility with VehicleKeyChain and Jaksams vehicle_keys

Resmon

Resmon without any near vehicles Screenshot_17

Resmon with near vehicles and engines on Screenshot_16

Requirements

Optional

Exports

All exports are CLIENTSIDE. Look at the Documentation for more information.

  • toggleEngine -> Toggles the engine on/off
  • toggleHotwire -> Starts the Hotwire Feature
  • GetEngineState -> Get the current Enginestate of the vehicle
  • SetVehicleDamaged -> Set the vehicle undrivable (Can't start/stop engine)
  • GetVehicleDamaged -> Get the vehicle is undrivable
  • SetSteeringAngle -> Set the steering angle
  • GetSteeringAngle -> Get the steering angle

RealisticVehicleDamage

If you use RealisticVehicleDamage, then replace following Code in client.lua on Line 333 in RealisticVehicleDamage:

if healthEngineCurrent > cfg.engineSafeGuard+1 then
    SetVehicleUndriveable(vehicle, false)
    exports.msk_enginetoggle:SetVehicleDamaged(vehicle, false)
end

if healthEngineCurrent <= cfg.engineSafeGuard+1 and cfg.limpMode == false then
    SetVehicleUndriveable(vehicle, true)
    exports.msk_enginetoggle:SetVehicleDamaged(vehicle, true)
end

QB-Vehiclefailure

If you use qb-vehiclefailure, then replace the following Code in client.lua on Line 530 in qb-vehiclefailure:

if healthEngineCurrent > cfg.engineSafeGuard+1 then
    SetVehicleUndriveable(vehicle, false)
    exports.msk_enginetoggle:SetVehicleDamaged(vehicle, false)
end

if healthEngineCurrent <= cfg.engineSafeGuard+1 and cfg.limpMode == false then
    local vehpos = GetEntityCoords(vehicle)
    StartParticleFxLoopedAtCoord("ent_ray_heli_aprtmnt_l_fire", vehpos.x, vehpos.y, vehpos.z-0.7, 0.0, 0.0, 0.0, 1.0, false, false, false, false)
    SetVehicleUndriveable(vehicle, true)
    exports.msk_enginetoggle:SetVehicleDamaged(vehicle, true)
end

My other Scripts

Paid

Free