Skip to content

Commit

Permalink
Fixed PlayerStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianBDev committed May 23, 2024
1 parent f440fd1 commit cdb9ce0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/job.lua
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ RegisterNetEvent('police:client:CheckStatus', function()
QBCore.Functions.TriggerCallback('police:GetPlayerStatus', function(result)
if result then
for _, v in pairs(result) do
QBCore.Functions.Notify('' .. v .. '')
QBCore.Functions.Notify('Player comes back with ' .. v)
end
end
end, playerId)
Expand Down
5 changes: 3 additions & 2 deletions locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ local Translations = {
no_driver_license = 'No drivers license',
not_cuffed_dead = 'Civilian isn\'t cuffed or dead',
fine_yourself = 'You Cannot Fine Yourself',
not_online = 'This person is not online'
not_online = 'This person is not online',
no_status = 'No status found for the person',
},
success = {
uncuffed = 'You have been uncuffed',
Expand Down Expand Up @@ -117,7 +118,7 @@ local Translations = {
officer_down = 'Officer %{lastname} | %{callsign} Down',
fine_issued = 'Fine has been issued to offender succesfully',
received_fine = 'State Debt Recovery has automatically recovered the fines owed...',
camera_speed= 'Speed camera #%{radarid} - Marked vehicle'
camera_speed = 'Speed camera #%{radarid} - Marked vehicle'

},
evidence = {
Expand Down
4 changes: 3 additions & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -542,14 +542,16 @@ QBCore.Functions.CreateCallback('police:server:isPlayerDead', function(_, cb, pl
cb(Player.PlayerData.metadata['isdead'])
end)

QBCore.Functions.CreateCallback('police:GetPlayerStatus', function(_, cb, playerId)
QBCore.Functions.CreateCallback('police:GetPlayerStatus', function(source, cb, playerId)
local Player = QBCore.Functions.GetPlayer(playerId)
local statList = {}
if Player then
if PlayerStatus[Player.PlayerData.source] and next(PlayerStatus[Player.PlayerData.source]) then
for k in pairs(PlayerStatus[Player.PlayerData.source]) do
statList[#statList + 1] = PlayerStatus[Player.PlayerData.source][k].text
end
else
TriggerClientEvent('QBCore:Notify', source, Lang:t('error.no_status'), 'error')
end
end
cb(statList)
Expand Down

0 comments on commit cdb9ce0

Please sign in to comment.