Skip to content

Commit

Permalink
Merge pull request #491 from citRaTTV/fix/leo-job-type
Browse files Browse the repository at this point in the history
Fix/leo job type
  • Loading branch information
GhzGarage authored Dec 31, 2023
2 parents 64643b1 + 9dd07bf commit 9b19ab9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions client/job.lua
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ RegisterNetEvent('police:client:EvidenceStashDrawer', function()
currentEvidence = k
end
end
local pos = GetEntityCoords(PlayerPedId())
local takeLoc = Config.Locations['evidence'][currentEvidence]

if not takeLoc then return end
Expand Down Expand Up @@ -461,7 +460,7 @@ RegisterNetEvent('qb-police:client:openArmoury', function()
price = item.price,
amount = item.amount,
info = item.info or {},
type = itemType,
type = itemInfo.type,
slot = #authorizedItemsList + 1
}
end
Expand Down
6 changes: 3 additions & 3 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
TriggerEvent('qb-clothing:client:loadOutfit', trackerClothingData)
end

if PlayerJob and PlayerJob.name ~= 'police' then
if PlayerJob and PlayerJob.type ~= 'leo' then
if DutyBlips then
for _, v in pairs(DutyBlips) do
RemoveBlip(v)
Expand Down Expand Up @@ -109,7 +109,7 @@ RegisterNetEvent('QBCore:Client:SetDuty', function(newDuty)
end)

RegisterNetEvent('QBCore:Client:OnJobUpdate', function(JobInfo)
if JobInfo.name ~= 'police' then
if JobInfo.type ~= 'leo' then
if DutyBlips then
for _, v in pairs(DutyBlips) do
RemoveBlip(v)
Expand Down Expand Up @@ -139,7 +139,7 @@ end)

RegisterNetEvent('police:client:UpdateBlips', function(players)
if PlayerJob and (PlayerJob.type == 'leo' or PlayerJob.type == 'ems') and
PlayerJob.onduty then
PlayerJob.onduty then
if DutyBlips then
for _, v in pairs(DutyBlips) do
RemoveBlip(v)
Expand Down
8 changes: 4 additions & 4 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ QBCore.Commands.Add('takedna', Lang:t('commands.takedna'), { { name = 'id', help
local src = source
local Player = QBCore.Functions.GetPlayer(src)
local OtherPlayer = QBCore.Functions.GetPlayer(tonumber(args[1]))
if not OtherPlayer or Player.PlayerData.job.name ~= 'police' or not Player.PlayerData.job.onduty then return end
if not OtherPlayer or Player.PlayerData.job.type ~= 'leo' or not Player.PlayerData.job.onduty then return end
if Player.Functions.RemoveItem('empty_evidence_bag', 1) then
local info = {
label = Lang:t('info.dna_sample'),
Expand Down Expand Up @@ -673,7 +673,7 @@ RegisterNetEvent('police:server:CuffPlayer', function(playerId, isSoftcuff)

local Player = QBCore.Functions.GetPlayer(src)
local CuffedPlayer = QBCore.Functions.GetPlayer(playerId)
if not Player or not CuffedPlayer or (not Player.Functions.GetItemByName('handcuffs') and Player.PlayerData.job.name ~= 'police') then return end
if not Player or not CuffedPlayer or (not Player.Functions.GetItemByName('handcuffs') and Player.PlayerData.job.type ~= 'leo') then return end

TriggerClientEvent('police:client:GetCuffed', CuffedPlayer.PlayerData.source, Player.PlayerData.source, isSoftcuff)
end)
Expand Down Expand Up @@ -763,7 +763,7 @@ RegisterNetEvent('police:server:BillPlayer', function(playerId, price)

local Player = QBCore.Functions.GetPlayer(src)
local OtherPlayer = QBCore.Functions.GetPlayer(playerId)
if not Player or not OtherPlayer or Player.PlayerData.job.name ~= 'police' then return end
if not Player or not OtherPlayer or Player.PlayerData.job.type ~= 'leo' then return end

OtherPlayer.Functions.RemoveMoney('bank', price, 'paid-bills')
exports['qb-banking']:AddMoney('police', price, 'Fine paid')
Expand All @@ -780,7 +780,7 @@ RegisterNetEvent('police:server:JailPlayer', function(playerId, time)

local Player = QBCore.Functions.GetPlayer(src)
local OtherPlayer = QBCore.Functions.GetPlayer(playerId)
if not Player or not OtherPlayer or Player.PlayerData.job.name ~= 'police' then return end
if not Player or not OtherPlayer or Player.PlayerData.job.type ~= 'leo' then return end

local currentDate = os.date('*t')
if currentDate.day == 31 then
Expand Down

0 comments on commit 9b19ab9

Please sign in to comment.