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.
Customization Files
Section titled “Customization Files”File Locations
Section titled “File Locations”ars_ambulance/├── client/│ └── cl_customize.lua -- Client-side customizations└── server/ └── sv_customize.lua -- Server-side customizationsClient Customizations
Section titled “Client Customizations”Custom Billing System
Section titled “Custom Billing System”function CustomBilling(playerId, amount) -- Add your own billing system here -- Available: Config.AmbulanceJob, lib.notify()
-- Example: TriggerServerEvent('my_billing:sendBill', playerId, amount, 'Ambulance Services')endCustom Vehicle Key System
Section titled “Custom Vehicle Key System”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 endendCustom Vehicle Fuel System
Section titled “Custom Vehicle Fuel System”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) endendCustom Distress Signal
Section titled “Custom Distress Signal”function SendCustomDistressSignal() -- Add custom phone/dispatch integration here TriggerServerEvent('ars_ambulance:PlayerDistressSignal')endServer Customizations
Section titled “Server Customizations”Custom Player Status Reset
Section titled “Custom Player Status Reset”RegisterNetEvent('ars_ambulance:resetPlayerThirstHunger', function() local src = source -- Add custom metadata resets hereend)Custom Inventory Clearing
Section titled “Custom Inventory Clearing”RegisterNetEvent('ars_ambulance:clearInventoryOnDeath', function() -- Add custom inventory clearing logic hereend)Custom Player Kick
Section titled “Custom Player Kick”RegisterNetEvent('ars_ambulance:kickPlayerForMisconduct', function(reason) -- Add custom kick/ban logic hereend)Client Customization Events
Section titled “Client Customization Events”Custom Player Status Reset
Section titled “Custom Player Status Reset”RegisterNetEvent('ars_ambulance:resetPlayerStatus', function() -- Add custom status reset logic here -- This is called when player is revived or checks inend)Custom Outfit Changes
Section titled “Custom Outfit Changes”RegisterNetEvent('ars_ambulance:changePlayerOutfit', function(outfitData) -- Add custom outfit logic here -- outfitData contains the outfit table to applyend)Custom Equipment Access
Section titled “Custom Equipment Access”RegisterNetEvent('ars_ambulance:accessEMSEquipmentStorage', function() -- Add custom storage access logic here -- Called when EMS player accesses equipment storageend)Discord Webhooks
Section titled “Discord Webhooks”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 = trueConfig.ReviveLogs = trueDeath Overlay Customization
Section titled “Death Overlay Customization”The death screen overlay can be customized using these helper functions in client/cl_customize.lua:
Available Functions
Section titled “Available Functions”-- Show the death overlay with custom dataShowDeathOverlay(data)
-- Hide the death overlayHideDeathOverlay()
-- Update the timer displayUpdateDeathOverlayTimer(time)
-- Update the incident reportUpdateIncidentReport(report)
-- Get killer informationGetKillerInfo()
-- Get cause of death informationGetCauseInfo()Example: Custom Death Overlay
Section titled “Example: Custom Death Overlay”-- Custom death overlay handlerRegisterNetEvent('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)UI Customization
Section titled “UI Customization”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.
Practical Integration Examples
Section titled “Practical Integration Examples”Custom Billing System Integration
Section titled “Custom Billing System Integration”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')endCustom Phone Integration
Section titled “Custom Phone Integration”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' })endAdding Custom Hospital Locations
Section titled “Adding Custom Hospital Locations”This example shows how to add a custom hospital:
- 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) } }}- 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 }}Custom Treatment Items
Section titled “Custom Treatment Items”Add custom treatment items by extending the config:
-- In config.luaConfig.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.