Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds export (client and server sided) for GetCops #527

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,16 @@ CreateThread(function()
EndTextCommandSetBlipName(blip)
end
end)

local function getCops()
local amount = 0
local recieved = false
QBCore.Functions.TriggerCallback('police:GetCops', function(data)
amount = data
recieved = true
end)
repeat Wait(1) until recieved
return amount
end

exports('GetCops', getCops)
1 change: 1 addition & 0 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ local function GetCurrentCops()
return amount
end

exports('GetCops', GetCurrentCops)
-- Callbacks

QBCore.Functions.CreateCallback('police:GetDutyPlayers', function(_, cb)
Expand Down
Loading