# Exports & Events

## EXPORTS

How to check if a player is dead

1. ```lua
   exports.ars_ambulancejob:isDead() -- returns true if dead
   ```
2. ```lua
   LocalPlayer.state.dead -- returns true if dead
   ```
3. ```lua
   local data = lib.callback.await('ars_ambulancejob:getData', false, targetServerId)
   local isDead = data.status.isDead
   ```

&#x20;  **Usage example**  &#x20;

```lua
RegisterCommand("test", function(source, args, rawCommand)
    local isDead = LocalPlayer.state.dead
    if isDead then
        print("player is dead")
    else
        print("alive")
    end    
end)
```

***

How to open distress call dialog

```lua
exports.ars_ambulancejob:createDistressCall()
```

&#x20;  **Usage example**  &#x20;

<pre class="language-lua"><code class="lang-lua">RegisterCommand("test2", function(source, args, rawCommand)
<strong>    exports.ars_ambulancejob:createDistressCall()
</strong><strong>end)
</strong></code></pre>

***

How to open distress calls menu

<pre class="language-lua"><code class="lang-lua"><strong>exports.ars_ambulancejob:openDistressCalls()
</strong></code></pre>

&#x20;  **Usage example**&#x20;

```lua
RegisterCommand("test3", function(source, args, rawCommand)
    exports.ars_ambulancejob:openDistressCalls()
end)
```

## EVENTS

How to use heal event (client)

1. ```lua
   TriggerEvent('ars_ambulancejob:healPlayer', {revive = true}) -- to revive player
   ```
2. <pre class="language-lua"><code class="lang-lua"><strong>TriggerEvent('ars_ambulancejob:healPlayer', {heal = true}) -- to heal player
   </strong></code></pre>
3. ```lua
   TriggerEvent('ars_ambulancejob:healPlayer', {injury = true, bone = "head" }) -- to heal injury of player
   ```

&#x20;  **Usage example**&#x20;

```lua
RegisterCommand("test4", function(source, args, rawCommand)
  TriggerEvent('ars_ambulancejob:healPlayer', {revive = true}) -- to revive player
end)

RegisterCommand("test5", function(source, args, rawCommand)
 TriggerEvent('ars_ambulancejob:healPlayer', {heal = true}) -- to heal player
end)

RegisterCommand("test6", function(source, args, rawCommand)
TriggerEvent('ars_ambulancejob:healPlayer', {injury = true, bone = "head" }) -- to heal injury of player
end)
```
