MSK Scripts
TebexGithubDiscordMusiker15
  • MSK Scripts
    • Welcome
  • Common Issues
    • Keymaster
  • Miscellaneous
    • Change Notifications
  • Scripts
    • MSK Core
      • Installation
      • Functions
        • Client
          • Ace Permission
          • Commands
          • Coords
          • Player
          • Points
          • Request
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
          • Vehicle
        • Shared
          • String
          • Math
          • Table
          • Timeout
          • Vector
        • Server
          • Ace Permission
          • Ban System
          • Commands
          • Player
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
    • MSK Banking
      • Installation
        • Paycheck Transaction
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Server Callbacks
    • MSK EngineToggle
      • Guides
      • Exports
        • Client
      • Event Handler
        • Client
        • Server
    • MSK Fuel
      • Config
      • Exports
        • Client
    • MSK Garage
      • Config
      • Exports
        • Client
    • MSK Handcuffs
      • Guides
        • General Edits for Jobs
        • Jaksam Job Creator
        • Multichar
        • ox_inventory
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Event Handlers
    • MSK Radio
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Server
    • MSK Simcard
      • Installation
        • Config.Database
      • Config
    • MSK VehicleKeys
      • Guides
        • Installation
        • Integrations
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
    • MSK Whitelist
      • Config
      • Exports
        • Client
        • Server
    • MSK Weaponammo
Powered by GitBook
On this page
  • RealisticVehicleFailure
  • QB-Vehiclefailure
  1. Scripts
  2. MSK EngineToggle

Guides

Guides for msk_enginetoggle

Last updated 8 months ago

With the following edits, you can set the vehicle to "damaged" so that you can't start the engine of the given vehicle.

If a player is driving this specific vehicle or the engine is on, the engine turns off automatically.

RealisticVehicleFailure

If you use RealisticVehicleFailure, then replace the following Code in client.lua on Line ~339:

client.lua - line ~339
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:

client.lua - line ~530
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