# Client Exports

## SendAlert

Send an alert to the police dispatch.

{% hint style="warning" %}
All data is optional except for (**coords, title, and type)**.
{% endhint %}

```lua
-- coords: Coordinates vector3(x, y, z) in which the alert is triggered
-- title: Title of the alert
-- type: Type of alert (GENERAL, RADARS, 215, DRUGS, FORCE, 48X) This is to filter the alerts in the dashboard
-- message: Alert message
-- job: Job group related to the alert
-- metadata: Additional metadata of the alert (vehicle model, color, plate, speed, weapon, ammo type, name of the subject, unit)
TriggerServerEvent("SendAlert:police", {
    coords = vector3(0, 0, 0),
    title = 'Alert title',
    type = 'GENERAL',
    message = 'Alert message',
    job = 'police',
    metadata = {
        model = 'Vehicle label',
        color = {255, 255, 255},
        plate = 'PLATE',
        speed = '100 kmh',
        weapon = 'Weapon name',
        ammotype = 'AMMO_PISTOL',
        name = 'Subject name',
        unit = 'ADAM-10',
    }
})
```

> Example of use

```lua
RegisterCommand('testalert', function(source, args, rawCommand)
    local coords = GetEntityCoords(PlayerPedId())
    TriggerServerEvent("SendAlert:police", {
        coords = coords,
        title = 'Test alert title',
        type = 'GENERAL',
        message = 'Test alert message',
        job = 'police',
    })
end)
```

***

## IsOnDuty

Check if the player is on duty.

```lua
exports['origen_police']:IsOnDuty()
```

***

## RobVehicle

Send a vehicle theft alert to the police.

```lua
exports['origen_police']:RobVehicle()
```

***

## DisableAutoAlerts

Toggle automatic alerts.

```lua
exports['origen_police']:DisableAutoAlerts()
```

***

## IsInPrision

Checks if the player is in jail.

```lua
exports['origen_police']:IsInPrision()
```

***

## SpawnInFederal

Spawns the player in the federal location.

```lua
-- data: Player information (PlayerData)
exports['origen_police']:SpawnInFederal(data)
```

***

## SetFederal

Set the player's federal timer with the specified duration in minutes.

<pre class="language-lua"><code class="lang-lua"><strong>-- time: Duration in minutes
</strong><strong>-- danger: Danger (yes or no)
</strong><strong>exports['origen_police']:SetFederal(time, danger)
</strong></code></pre>

***

## SetWantedLevel

Set the player's wanted level.

```lua
-- level: Wanted level Min: 0, Max: 5
exports['origen_police']:SetWantedLevel(level)
```

***

## IsHandCuffed

Check if the player is handcuffed.

```lua
-- Returns a bool if it is cuffed
exports['origen_police']:IsHandcuffed()
```

***

## CanOpenTablet

Check if the player has access to the menu.

```lua
--Return a table with data (1: true or false, 2: job category, 3: penalfilter)
-- job: Player job
exports['origen_police']:CanOpenTablet(job)
```

***

## GetMinimunGrade

```lua
-- Returns whether the player has the minimum grade to perform a specific action.
-- job: Player job
-- param: Action to perform
exports['origen_police']:GetMinimunGrade(job, action)
```

> Example of use

```lua
if exports['origen_police']:GetMinimunGrade(job, 'RadioTab') >= job.grade.level then
    -- They have the grade to perform the action with their current job.
    return true
else
    -- They do not have the grade to perform the action with their current job.
    return false    
end
```

***

## TogglePause

Toggle the police tablet.

<pre class="language-lua"><code class="lang-lua"><strong>-- bool: true/false
</strong><strong>exports['origen_police']:TogglePause(bool)
</strong></code></pre>

***

## ShowBills

Display the police fines menu.

<pre class="language-lua"><code class="lang-lua"><strong>-- Display player bills in menu
</strong><strong>exports['origen_police']:ShowBills()
</strong></code></pre>

***

## GetBills

Get a list of fines for the player.

<pre class="language-lua"><code class="lang-lua"><strong>-- Get player bills
</strong><strong>exports['origen_police']:GetBills()
</strong></code></pre>

***

## Toggle

Toggle radio communication.

```lua
exports['origen_police']:Toggle()
```

***
