QBCore
CreateThread(function()
if Config.framework ~= 'QB' then return end
QBCore = exports['qb-core']:GetCoreObject()
-- GetPlayer
function GetPlayer()
local players = QBCore.Functions.GetPlayers()
return players
end
-- Retrieves the player's service status
function IsPlayerOnDuty(player)
local playerData = QBCore.Functions.GetPlayer(player).PlayerData
if playerData.job and playerData.job.onduty then
return true
else
return false
end
end
-- Recover the player's profession
function GetPlayerJob(player)
local playerData = QBCore.Functions.GetPlayer(player).PlayerData
if playerData.job then
return playerData.job
else
return nil
end
end
-- Retrieves the player's profession name
function GetPlayerJobName(player)
local playerData = QBCore.Functions.GetPlayer(player).PlayerData
if playerData.job and playerData.job.name then
return playerData.job.name
else
return nil
end
end
function GetPlayerId(player)
local playerData = QBCore.Functions.GetPlayer(player).PlayerData
if playerData.source then
return playerData.source
else
return nil
end
end
-- Fines
function ProcessFinalBillingPriceValue(finalBillingPrice, group)
local player = QBCore.Functions.GetPlayer(source)
if player then
player.Functions.RemoveMoney('bank', finalBillingPrice)
local agentJob = group
local addMoneyTo = Config.FinesTransf[agentJob]
if addMoneyTo then
exports['qb-management']:AddMoney(addMoneyTo, finalBillingPrice)
-- print("Argent ajouté à " .. addMoneyTo .. " pour prise de radar " .. agentJob)
else
print("No money mapping is defined for agent work: " .. agentJob)
end
else
print("Error: Player not found.")
end
end
end)
Last updated