Client

Here are some useful Events and Exports


ESX Ambulancejob Dispatch Integration

Step 1: Locate the Function

Navigate to your esx_ambulancejob/client/main.lua file and find the following code:

function SendDistressSignal()
    local playerPed = PlayerPedId()
    local coords = GetEntityCoords(playerPed)

    ESX.ShowNotification(TranslateCap('distress_sent'))
    TriggerServerEvent('esx_ambulancejob:onPlayerDistress')
end

Step 2: Modify the Function

Replace the existing code with the following updated version:

function SendDistressSignal()
    local playerPed = PlayerPedId()
    local coords = GetEntityCoords(playerPed)
    local xPlayer = ESX.GetPlayerData()
    local firstName = xPlayer.firstName
    local lastName = xPlayer.lastName
    local playerName = firstName .. " " .. lastName
    local location = "Urban district"

    ESX.ShowNotification(TranslateCap('distress_sent'))

    TriggerServerEvent('rs_dispatch:gotdispatch', playerName, coords, location)
end

This ensures that the SendDistressSignal()function correctly triggers the dispatch when called.

TriggerServerEvent('rs_dispatch:gotdispatch', playerName, coords, location)

Last updated