βοΈConfiguration
Below is a condensed view of config.lua
. Adjust values to fit your serverβs needs.
Language
UI language (en
, de
, fr
, es
, pt
)
"en"
Framework
Framework detection (auto
, esx
, qb
)
"auto"
Timeout
Seconds until bleed-out timer expires
10
BleedingTimeout
Seconds until forced respawn
600
DispatchSystem
Dispatch trigger: "qb-ambulancejob"
, "esx_ambulancejob"
, or "custom"
"custom"
removeItemsAfterRespawn
Remove all inventory items on respawn
true
removeCashAfterRespawn
Remove all cash on respawn
true
weaponWithItem
Keep weapons if tied to an inventory item
false
antiCombatLog
Re-trigger deathscreen on disconnected players
true
Freecam
Settings for free camera during bleed-out
β
radius
Max distance from death position
50.0
everyone_canUse
Allow all players freecam access
true
marker_color
RGB color for freecam boundary marker
{r=255,g=242,b=0}
admins
List of Steam identifiers allowed to freecam regardless of everyone_canUse
[...]
SkipZones
Bypass deathscreen in custom zones via export checks
β
RespawnPoints
World coordinates for manual respawn selection
{{x,y,z,h},β¦}
Config = {}
-- General localisation
Config.Locales = {} -- Holds translation tables
Config.Language = "en" -- language
-- Framework & performance
Config.Framework = "auto" -- auto = detect ESX or QBCore; or force "esx"/"qb"
Config.Timeout = 10 -- Seconds to wait for allow respawn
Config.BleedingTimeout = 600 -- Seconds until forced bleed-out
-- Integration with other scripts
Config.DispatchSystem = "custom" -- "qb-ambulancejob", "esx_ambulancejob" or "custom"
-- Death / respawn penalties
Config.removeItemsAfterRespawn = true -- Remove inventory items on hospital respawn
Config.removeCashAfterRespawn = true -- Remove cash on hospital respawn
Config.weaponWithItem = false -- Drop weapons only if their item is present
Config.antiCombatLog = true -- Punish logging-out while dead
-- Free-camera settings (admin tool)
Config.Freecam = {
radius = 50.0, -- Max cam distance from player
everyone_canUse = true, -- Allow all players (or only admins)
marker_color = { r = 255, g = 242, b = 0 }, -- RGB marker colour
admins = {
"5a97123456asdasd911234as12123sad213a"
}
}
-- Zones in which the death system is skipped (e.g. minigames)
Config.SkipZones = {
{ resource = "fs_ffa", export = "IsInZone", args = {} },
{ resource = "frp_airdrop", export = "IsInZone", args = {} }
}
-- Fixed hospital respawn positions
Config.RespawnPoints = {
vector4(341.0, -1397.3, 32.5, 48.5), -- Central Los Santos
vector4(1836.03, 3670.99, 34.28, 296.06) -- Sandy Shores
}
-- Client-side controls (Keybinds)
Config.Controls = {
freeCam = "F", -- Toggle freecam
sync_character = "U", -- Force resync with server
dispatch = "G" -- Send distress alert
}
-- Cross-framework revive triggers (add more if needed)
Config.ReviveEvents = {
{ type = "client", event = "esx_ambulancejob:revive" },
{ type = "client", event = "hospital:client:RespawnAtHospital" }
}
-- Callback: runs after player respawn is complete
function onRespawn()
-- custom logic (empty by default)
end
-- HUD helpers
function hideHud()
exports['risk-hud']:show(false)
end
function showHud()
exports['risk-hud']:show(true)
end
-- Remove items via native framework scripts
function removeItems()
if GetResourceState('esx_ambulancejob') then
exports["esx_ambulancejob"]:RemoveItemsAfterRPDeath()
end
end
-- Dispatch integrations
function dispatch()
if Config.DispatchSystem == "qb-ambulancejob" then
TriggerServerEvent('hospital:server:ambulanceAlert', "Critical Medical Condition")
elseif Config.DispatchSystem == "esx_ambulancejob" then
TriggerServerEvent('esx_ambulancejob:onPlayerDistress')
else
-- Example for custom phone API (commented)
-- local ped = PlayerPedId()
-- local coords = GetEntityCoords(ped)
-- exports["lb-phone"]:SendCompanyMessage("ambulance", "Unconscious person needs help", false)
-- exports["lb-phone"]:SendCompanyCoords("ambulance", coords, false)
end
end
-- Detect and return active framework object
function getFramework()
if Config.Framework == "esx" then
return exports['es_extended']:getSharedObject(), "esx"
elseif Config.Framework == "qb" then
return exports["qb-core"]:GetCoreObject(), "qb"
elseif Config.Framework == "auto" then
if GetResourceState('qb-core') == 'started' then
return exports["qb-core"]:GetCoreObject(), "qb"
elseif GetResourceState('es_extended') == 'started' then
return exports['es_extended']:getSharedObject(), "esx"
end
end
end
Last updated