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

Fix/leo job type #491

Merged
merged 3 commits into from
Dec 31, 2023
Merged
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
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
Loading