-- Server
QBCore.Functions.TriggerCallback('job:sorgu', function(source, cb)
cb(getJob("police"))
end)
function getJob(jobadi)
local job = 0
local xPlayers = QBCore.Functions.GetPlayers()
for i=1, #xPlayers, 1 do
local xPlayer = QBCore.Functions.GetPlayer(xPlayers[i])
if jobadi == "police" then
if xPlayer.PlayerData.job.name == "police" then
job = job + 1
end
end
end
return job
end
-- Client
local pdsayi = 3
QBCore.Functions.CreateCallback('job:sorgu', function(miktar)
if miktar >= pdsayi then
-- burda artık soyma triggeri veya işevi..
else
ESX.Notify("HaveFun Cooldown :D - Yeterli Polis Sayısı yok!..",3000,"warning")
end