> For the complete documentation index, see [llms.txt](https://deun-services.gitbook.io/deun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://deun-services.gitbook.io/deun/d-phone/ambulancejob-esx.md).

# Ambulancejob ( ESX )

This page contains 2 Installation. 1. Adding Dispatches 2. Adding the GetDeath event to your ambulancejob

## Adding Dispatches

1. Navigate to your *<mark style="color:purple;">\<esx\_ambulancejob></mark>* > *<mark style="color:purple;">\<main.lua></mark>* file.&#x20;
2. Search for the SendDistressSignal() function in the file.&#x20;
3. Replace the entire function with the following code:

```lua
function SendDistressSignal()
	TriggerEvent("d-phone:client:message:senddispatch", "Unconscious person", "ambulance")
	TriggerEvent("d-notification", "Service Message sended", 5000,  "success")
end
```

{% hint style="danger" %}
Make sure to replace "ambulance" with your actual job name if you renamed the job.
{% endhint %}

4. Save the file and restart your server.

{% embed url="<https://www.youtube.com/watch?v=Q9aA3GexBIc>" %}

## Adding the GetDeath export to your Ambulancejob

1. Navigate to your *<mark style="color:purple;">\<esx\_ambulancejob></mark>* > *<mark style="color:purple;">\<main.lua></mark>* file.&#x20;
2. Add the following code to the bottom of the file:

```lua
function GetDeath()
    if IsDead then
        return true
    elseif not IsDead then
        return false
    end
end

```

3. Save the file.&#x20;
4. Open your *<mark style="color:purple;">\<fxmanifest.lua></mark>* or *<mark style="color:purple;">\<resource.lua></mark>* ( of your ambulance job ) file.&#x20;
5. Add the following code also at the bottom to the file:

```lua
exports {
    'GetDeath'
}
```

6. Save the file and restart your server.
