Kxiox Scripts
  • 📢Discord
  • 💻GitHub
  • 🛡️ks_insurance
    • 📼Preview
    • ⬇️Download and install
    • ⚙️Configuration
    • 💻Developer
  • 💼ks_jobchanger
    • 📼Preview
    • ⬇️Download and install
    • ⚙️Configuration
  • 🔥ks_hydrants
    • 📼Preview
    • ⬇️Download and install
    • ⚙️Configuration
    • 💻Developer
Powered by GitBook
On this page
  • Default Config
  • Configurable functions
  • function canOpenMenu()
  • function SkillCheck()
  • function allowDestroy()
  • function canRepair()
  • function dispatch(coords)
  • If you need help to configurate the config, use the free service on my Discord.
  1. ks_hydrants

Configuration

Default Config

Config = {}

Config.Locale = 'en'

Config.PrintLocationInConsole = false -- print coords of destroyed hydrant in console

Config.ExtraList = { -- extralist if some hydrants missing (vector3())

}

Config.Command = 'hydrants'

Config.Marker = { -- marker options for destroyed hydrants
    color = {r = 255, g = 255, b = 0, a = 200}
}

Config.Blip = {
    sprite = 436,
    color = 1,
    scale = 0.5
}

Config.DestroyerInterval = 60000 * 45 -- time (ms) between hydrant destroy (default: 45m)

function canOpenMenu() -- permission to open menu
    return true
end

function SkillCheck()
    return lib.skillCheck({'easy', 'easy', 'easy', 'easy', 'medium', 'medium'}, {'w', 'a', 's', 'd'})
end

function allowDestroy() -- when can a hydrant destroy
    return true
end

function canRepair()
    return true
end

function dispatch(coords) --dispatch for destroyed hydrants
    TriggerEvent('emergencydispatch:emergencycall:new', 'fire', Locales[Config.Locale]['dispatch_description'], coords, true)
end

function Notify(text, type, time)
    lib.notify({
        title = Locales[Config.Locale]['notify_title'],
        description = text,
        type = type,
        duration = time,
        position = 'top'
    })
end

function HelpNotify(type)
    lib.showTextUI('[E] - Repair', {
        position = "top-center",
        icon = 'wrench',
        style = {
            backgroundColor = '#478611',
            color = 'white'
        }
    })
end

Configurable functions

function canOpenMenu()

Template

ESX = exports['es_extended']:getSharedObject()

if ESX.PlayerData.job.name == 'fire' then
    return true
end
  • Client function

  • Function for permission to open the menu

  • Important: return

  • Return must be boolean

function SkillCheck()

Template

return lib.skillCheck({'easy', 'easy', 'easy', 'easy', 'medium', 'medium'}, {'w', 'a', 's', 'd'})
  • Client function

  • Function for SkillCheck to repair the hydrant

  • Important: return

  • Return must be boolean

function allowDestroy()

Template

ESX = exports['es_extended']:getSharedObject()
local xPlayers = ESX.GetPlayers()
local firejob = 0

for i=1, #xPlayers, 1 do
    if xPlayer then
        if xPlayer.getJob().name == 'fire' then
            firejob = firejob + 1
        end
    end
end

if firejob >= 3 then
    return true
else
    return false
end
  • Server function

  • Function to allow a hydrant to be destroyed

  • Important: return

  • Return must be boolean

function canRepair()

Template

ESX = exports['es_extended']:getSharedObject()

if ESX.PlayerData.job.name == 'fire' then
    return true
end
  • Client function

  • Function for permission to repair

  • Important: return

  • Return must be boolean

function dispatch(coords)

Template

TriggerEvent('emergencydispatch:emergencycall:new', 'fire', Locales[Config.Locale]['dispatch_description'], coords, true)
  • Server function

  • Function for sending a dispatch when a hydrant has been destroyed

  • No return required

PreviousDownload and installNextDeveloper

Last updated 9 months ago

Docs for SkillCheck:

If you need help to configurate the config, use the free service on my .

🔥
⚙️
https://overextended.dev/ox_lib/Modules/Interface/Client/skillcheck
Discord