Skip to content

Customization Guide

ARS Ambulance provides two dedicated customization files that allow you to integrate custom systems without modifying the core script. These files are escrow-ignored, meaning your customizations are preserved after updates.

ars_ambulance/
├── client/
│ └── cl_customize.lua -- Client-side customizations
└── server/
└── sv_customize.lua -- Server-side customizations

function CustomBilling(playerId, amount)
-- Add your own billing system here
-- Available: Config.AmbulanceJob, lib.notify()
-- Example:
TriggerServerEvent('my_billing:sendBill', playerId, amount, 'Ambulance Services')
end
function GiveCarKeys(plate, _model, _vehicle)
if GetResourceState('qb-vehiclekeys') == 'started' then
TriggerEvent('vehiclekeys:client:SetOwner', plate)
elseif GetResourceState('wasabi_carlock') == 'started' then
exports.wasabi_carlock:GiveKey(plate)
elseif GetResourceState('t1ger_keys') == 'started' then
local name = GetDisplayNameFromVehicleModel(_model)
exports['t1ger_keys']:GiveJobKeys(plate, name, false, Config.AmbulanceJob)
elseif GetResourceState('ars_vehiclekeys') == 'started' then
local name = GetDisplayNameFromVehicleModel(_model)
exports['ars_vehiclekeys']:GiveJobKeys(plate, name, Config.AmbulanceJob)
else
-- Add custom key logic here
end
end
function SetVehicleFuel(vehicle, value)
if Config.FuelSystem == 'legacy' then
exports.LegacyFuel:SetFuel(vehicle, value)
elseif Config.FuelSystem == 'ox' then
Entity(vehicle).state.fuel = value
elseif Config.FuelSystem == 'ps' then
exports['ps-fuel']:SetFuel(vehicle, value)
else
SetVehicleFuelLevel(vehicle, value)
end
end
function SendCustomDistressSignal()
-- Add custom phone/dispatch integration here
TriggerServerEvent('ars_ambulance:PlayerDistressSignal')
end

RegisterNetEvent('ars_ambulance:resetPlayerThirstHunger', function()
local src = source
-- Add custom metadata resets here
end)
RegisterNetEvent('ars_ambulance:clearInventoryOnDeath', function()
-- Add custom inventory clearing logic here
end)
RegisterNetEvent('ars_ambulance:kickPlayerForMisconduct', function(reason)
-- Add custom kick/ban logic here
end)

RegisterNetEvent('ars_ambulance:resetPlayerStatus', function()
-- Add custom status reset logic here
-- This is called when player is revived or checks in
end)
RegisterNetEvent('ars_ambulance:changePlayerOutfit', function(outfitData)
-- Add custom outfit logic here
-- outfitData contains the outfit table to apply
end)
RegisterNetEvent('ars_ambulance:accessEMSEquipmentStorage', function()
-- Add custom storage access logic here
-- Called when EMS player accesses equipment storage
end)

Configure webhooks in server/sv_customize.lua:

Webhooks = {
deathLogs = {
webhook = 'YOUR_WEBHOOK_URL',
color = 15548997 -- Red
},
reviveLogs = {
webhook = 'YOUR_WEBHOOK_URL',
color = 15548997 -- Red
}
}

Enable in config.lua:

Config.DeathLogs = true
Config.ReviveLogs = true

The death screen overlay can be customized using these helper functions in client/cl_customize.lua:

-- Show the death overlay with custom data
ShowDeathOverlay(data)
-- Hide the death overlay
HideDeathOverlay()
-- Update the timer display
UpdateDeathOverlayTimer(time)
-- Update the incident report
UpdateIncidentReport(report)
-- Get killer information
GetKillerInfo()
-- Get cause of death information
GetCauseInfo()
-- Custom death overlay handler
RegisterNetEvent('ars_ambulance:customDeathOverlay', function()
local killerInfo = GetKillerInfo()
local causeInfo = GetCauseInfo()
-- Create custom overlay data
local customData = {
killer = killerInfo.name,
cause = causeInfo.weapon,
location = GetEntityCoords(PlayerPedId())
}
-- Show custom overlay
ShowDeathOverlay(customData)
end)

The death overlay uses an NUI interface. You can customize the appearance by modifying html/index.html and html/script.js.

Note: NUI customization requires HTML, CSS, and JavaScript knowledge.

This example shows how to integrate with a custom billing system:

function CustomBilling(playerId, amount)
local target = GetPlayerFromId(playerId)
if not target then return end
-- Example: Using okokBilling
TriggerServerEvent('okokBilling:CreateBill', playerId, 'Ambulance Services', amount, 'EMS Treatment')
-- Example: Using custom billing
-- TriggerServerEvent('my_billing:sendBill', playerId, amount, 'Ambulance Services', 'EMS Treatment')
end

This example shows how to integrate with a phone system for distress signals:

function SendCustomDistressSignal()
local playerCoords = GetEntityCoords(PlayerPedId())
local playerData = {
name = GetPlayerName(PlayerId()),
coords = playerCoords,
isInjured = true,
needsEMS = true
}
-- Example: GKS Phone
TriggerServerEvent('gksphone:server:sendEmergencyAlert', 'ambulance', playerData)
-- Example: QS Phone
TriggerServerEvent('qs-smartphone:server:sendEmergencyMessage', {
message = 'EMS needed at location!',
coords = playerCoords,
emergency = 'ambulance'
})
end

This example shows how to add a custom hospital:

  1. Create hospital config in hospital/pillbox.lua:
Config.Locations['sandyshores'] = {
RespawnPoint = {
coords = vector3(1836.19, 3672.91, 34.28),
heading = 210.0
},
Blip = {
Enabled = true,
Coords = vec3(1839.45, 3672.98, 34.28),
Sprite = 61,
Color = 2,
Scale = 0.8,
String = 'Sandy Shores Medical'
},
CheckIn = {
coords = vector3(1840.47, 3678.54, 34.28),
heading = 30.0,
distance = 3.0
},
BossMenu = {
coords = vector3(1835.67, 3678.54, 34.28),
heading = 90.0,
distance = 2.0
},
Vehicles = {
coords = vector3(1823.87, 3691.45, 34.22),
heading = 210.0,
distance = 5.0
},
Helicopter = {
coords = vector3(1856.23, 3701.23, 34.27),
heading = 90.0,
distance = 5.0
},
Elevators = {
{ floor = 3, label = 'Rooftop', coords = vector3(1844.89, 3691.59, 38.50) },
{ floor = 2, label = 'Main Floor', coords = vector3(1838.42, 3684.14, 34.28) },
{ floor = 1, label = 'Lower Level', coords = vector3(1833.27, 3688.73, 30.28) }
}
}
  1. Configure beds in the same file:
Config.HospitalBeds['sandyshores'] = {
{ coords = vector3(1835.12, 3675.34, 34.28), heading = 160.0, model = 1631638868 },
{ coords = vector3(1837.28, 3675.34, 34.28), heading = 160.0, model = 1631638868 },
{ coords = vector3(1839.44, 3675.34, 34.28), heading = 160.0, model = 1631638868 }
}

Add custom treatment items by extending the config:

-- In config.lua
Config.CustomTreatmentItems = {
['advancedmedikit'] = {
healAmount = 100, -- Full heal
duration = 3 * Seconds,
required = true
},
['adrenaline'] = {
revive = true,
duration = 5 * Seconds,
required = true
}
}

Then handle the custom items in your treatment logic.


Note: This guide is written by a third party. If you find any incorrect or outdated information, please contact us on Discord so we can update it for you.