NextScripts
  • NextScripts Documentation
  • ESX Scripts
    • ✅Garage System
      • Installation
      • SQL
      • Configuration
        • Main Config
        • Blips Config
        • Commands Config
        • Zones Config
      • Events & Exports
        • Client
          • Deformation
          • getExtraData - Export
          • SpawnVehicle - Export
          • StoreVehicle - Export
          • isInAnyMarker - Export
          • impound - Export
          • pdimpound - Export
        • Server
          • Deformation
      • Commands
    • 🛠️Engine System
      • Installation
      • Configuration
      • Events & Exports
        • Client
        • Server
    • 🛠️Vehicle Lock
Powered by GitBook
On this page
  1. ESX Scripts
  2. Engine System

Configuration

Config = {}

Config.Main = {
    AntiSpam = 1000, -- 1000ms, 0 = off
    AntiSpamMessage = "You are doing that too fast!",

    HotkeyKey = "vehicle:engine",
    HotkeyLabel = "(Vehicle) Engine On / Off",
    HotkeyInput = "N",

    StateBag = "engine",

    EnableCommand = true,
    Command = "engine",
    CommandNeedGroup = "user",
    CommandHelp = "Turn on / off the engine of the vehicle",

    EnableAdminCommand = true,
    AdminCommand = "engineadmin",
    AdminCommandNeedGroup = "admin",
    AdminCommandHelp = "Turn on / off the engine of the vehicle for another player",

    Client = {
        NotifyFunction = function(message, time, type)
            ESX.ShowNotification(message)
        end,

        HasFuel = function(vehicle)
            -- With this function you can get the fuel of the vehicle.
            -- return true will allow the player to start the engine.
            -- return false will block the player from starting the engine.      
            return true
        end,

        HasKey = function(vehicle)
            -- With this function you can check if the player has the key.
            -- return true will allow the player to start the engine.
            -- return false will block the player from starting the engine.
            return true
        end,

    },

    Server = {
        NotifyFunction = function(source, message, time, type)
            TriggerClientEvent('esx:showNotification', source, message)
        end
    },

    Texts = {
        EngineOff = "The engine has been ~r~stopped",
        EngineOn = "The engine has been ~g~started",
        NoFuel = "The vehicle has no ~y~gasoline",
        NoKey = "You don't have keys for this vehicle",
    
        NotInVehicle = "You are not in a vehicle",
        NoTarget = "Player not found",
    
        AdminToggleSuccess = "The engine has been ~g~started",
    },
}
PreviousInstallationNextEvents & Exports

Last updated 1 year ago

🛠️