# exports / triggers

## Client Exports / Triggers

<table><thead><tr><th width="445" align="center">Export</th><th align="center">Result</th></tr></thead><tbody><tr><td align="center">exports.brutal_policejob:getAvailableCopsCount()</td><td align="center">Number of police officers on duty on the server.</td></tr><tr><td align="center">exports.brutal_policejob:IsHandcuffed()</td><td align="center">true / false</td></tr><tr><td align="center">TriggerEvent('brutal_policejob:client:UseHandCuffKeyItem')</td><td align="center">You can remove the nearest player's handcuff with this event.</td></tr><tr><td align="center">TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'jail', TIME, REASON)</td><td align="center">To send the player jail.</td></tr><tr><td align="center">TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'cuff', MY_ID)</td><td align="center">Cuff trigger.</td></tr><tr><td align="center">TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'uncuff', MY_ID)</td><td align="center">Uncuff trigger</td></tr><tr><td align="center">TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'drag', MY_ID)</td><td align="center">Drag trigger.</td></tr><tr><td align="center"><p>x,y,z = table.unpack(GetEntityCoords(PlayerPedId()))</p><p>streetLabel = GetStreetNameFromHashKey(GetStreetNameAtCoord(x,y,z)) TriggerServerEvent('brutal_policejob:server:citizencall', 'create', text, {x,y,z}, streetLabel)</p></td><td align="center">ONLY FROM client side. With this event you can export to the mdt citizen calls.</td></tr><tr><td align="center">TriggerEvent('brutal_policejob:client:ToggleDuty')</td><td align="center">Switch between the duty status. ON/FALSE</td></tr></tbody></table>

For example:

<pre class="language-lua"><code class="lang-lua">local onlicePolice = exports.brutal_policejob:getAvailableCopsCount()
if onlicePolice >= 3 then
     print('enough cop to start the robbery')
end

RegisterCommand('jail', function()
<strong>     TARGET_ID = YOU_SHOULD_DEFINIED_IT
</strong><strong>     TIME = 60
</strong><strong>     REASON = 'Jail Reason'
</strong>     TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'jail', TIME, REASON)
end)

RegisterCommand('unjail', function()
    TARGET_ID = YOU_SHOULD_DEFINIED_IT
    TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'unjail')
end)

RegisterCommand('cuff', function()
<strong>     TARGET_ID = YOU_SHOULD_DEFINIED_IT
</strong><strong>     MY_ID = YOU_SHOULD_DEFINIED_IT
</strong>     TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'cuff', MY_ID)
end)

RegisterCommand('uncuff', function()
     TARGET_ID = YOU_SHOULD_DEFINIED_IT
     MY_ID = YOU_SHOULD_DEFINIED_IT
     TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'uncuff', MY_ID)
end)

RegisterCommand('drag', function()
     TARGET_ID = YOU_SHOULD_DEFINIED_IT
     MY_ID = YOU_SHOULD_DEFINIED_IT
     TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'drag', MY_ID)
end)
</code></pre>

## Server Events

```lua
TriggerEvent('brutal_policejob:server:getAvailableCopsCount', source, function(value)
    policeOnline =  value
end)


With this event you can get the player's Duty status. (true = false)

local player_job_name = YOU_SHOULD_DEFINIED_IT
TriggerEvent('brutal_policejob:server:GetDutyStatus', source, player_job_name, function(DutyStatus)
    if DutyStatus then
        print('Duty Status: true')
    else
        print('Duty Status: false')
    end
end)
```
