From 4ef8571573321dbaef27efd043e984199b5f56fa Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Thu, 9 Jan 2025 01:37:04 -0800 Subject: [PATCH 1/2] add export GetCops --- client/main.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/main.lua b/client/main.lua index 82dd5a9e..380c63f7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -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) From 6048e1e06969018bb421680cc01eb099bdb6d547 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Thu, 9 Jan 2025 01:37:41 -0800 Subject: [PATCH 2/2] add export GetCops --- server/main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/server/main.lua b/server/main.lua index 1f65dcaf..9578da46 100644 --- a/server/main.lua +++ b/server/main.lua @@ -39,6 +39,7 @@ local function GetCurrentCops() return amount end +exports('GetCops', GetCurrentCops) -- Callbacks QBCore.Functions.CreateCallback('police:GetDutyPlayers', function(_, cb)