Page cover image

exports / triggers

Client Exports / Triggers

Export
Result

exports.brutal_policejob:getAvailableCopsCount()

Number of police officers on duty on the server.

exports.brutal_policejob:IsHandcuffed()

true / false

TriggerEvent('brutal_policejob:client:UseHandCuffKeyItem')

You can remove the nearest player's handcuff with this event.

TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'jail', TIME, REASON)

To send the player jail.

TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'cuff', MY_ID)

Cuff trigger.

TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'uncuff', MY_ID)

Uncuff trigger

TriggerServerEvent('brutal_policejob:server:policeMenuEvent', TARGET_ID, 'drag', MY_ID)

Drag trigger.

x,y,z = table.unpack(GetEntityCoords(PlayerPedId()))

streetLabel = GetStreetNameFromHashKey(GetStreetNameAtCoord(x,y,z)) TriggerServerEvent('brutal_policejob:server:citizencall', 'create', text, {x,y,z}, streetLabel)

ONLY FROM client side. With this event you can export to the mdt citizen calls.

TriggerEvent('brutal_policejob:client:ToggleDuty')

Switch between the duty status. ON/FALSE

For example:

local onlicePolice = exports.brutal_policejob:getAvailableCopsCount()
if onlicePolice >= 3 then
     print('enough cop to start the robbery')
end

RegisterCommand('jail', function()
     TARGET_ID = YOU_SHOULD_DEFINIED_IT
     TIME = 60
     REASON = 'Jail Reason'
     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()
     TARGET_ID = YOU_SHOULD_DEFINIED_IT
     MY_ID = YOU_SHOULD_DEFINIED_IT
     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)

Server Events

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)

Last updated

Was this helpful?