From 9dd832c3236f72163d66528e6715fc17d633e48e Mon Sep 17 00:00:00 2001 From: Swellington Soares Date: Thu, 11 Jan 2024 19:47:48 -0300 Subject: [PATCH 1/2] fix impound event duplicating vehicle --- client/job.lua | 3 ++- server/main.lua | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/job.lua b/client/job.lua index e19fe2b1..9b6f27b0 100644 --- a/client/job.lua +++ b/client/job.lua @@ -128,8 +128,9 @@ function TakeOutImpound(vehicle) closeMenuFull() TaskWarpPedIntoVehicle(PlayerPedId(), veh, -1) TriggerEvent('vehiclekeys:client:SetOwner', QBCore.Functions.GetPlate(veh)) - SetVehicleEngineOn(veh, true, true) + SetVehicleEngineOn(veh, true, true, true) end, vehicle.plate) + end, vehicle.vehicle, coords, true) end end diff --git a/server/main.lua b/server/main.lua index 59fe4ed3..3e6e6f66 100644 --- a/server/main.lua +++ b/server/main.lua @@ -658,7 +658,6 @@ RegisterNetEvent('police:server:TakeOutImpound', function(plate, garage) local playerCoords = GetEntityCoords(playerPed) local targetCoords = Config.Locations['impound'][garage] if #(playerCoords - targetCoords) > 10.0 then return DropPlayer(src, 'Attempted exploit abuse') end - MySQL.update('UPDATE player_vehicles SET state = ? WHERE plate = ?', { 0, plate }) TriggerClientEvent('QBCore:Notify', src, Lang:t('success.impound_vehicle_removed'), 'success') end) From 113d74a58c5b84af092b140a9454986a22c9b5f2 Mon Sep 17 00:00:00 2001 From: Swellington Soares Date: Thu, 11 Jan 2024 20:14:06 -0300 Subject: [PATCH 2/2] update multi language to target label --- client/anpr.lua | 2 +- client/job.lua | 12 ++++++------ locales/en.lua | 16 +++++++++++++--- locales/pt-br.lua | 11 ++++++++++- server/main.lua | 3 +-- 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/client/anpr.lua b/client/anpr.lua index 877bec58..235f37f9 100644 --- a/client/anpr.lua +++ b/client/anpr.lua @@ -27,7 +27,7 @@ local function HandleSpeedCam(speedCam, radarID) sprite = 488, color = 1, scale = 0.9, - text = 'Speed camera #' .. radarID .. ' - Marked vehicle' + text = Lang:t('info.camera_speed', { radarid = radarID}) } local street1, street2 = table.unpack(GetStreetNameAtCoord(coords.x, coords.y, coords.z)) TriggerServerEvent('police:server:FlaggedPlateTriggered', radarID, plate, street1, street2, blipsettings) diff --git a/client/job.lua b/client/job.lua index 0df6f99b..de5abc38 100644 --- a/client/job.lua +++ b/client/job.lua @@ -700,7 +700,7 @@ if Config.UseTarget then type = 'client', event = 'qb-policejob:ToggleDuty', icon = 'fas fa-sign-in-alt', - label = 'Sign In', + label = Lang:t('target.sign_in'), jobType = 'leo', }, }, @@ -720,7 +720,7 @@ if Config.UseTarget then type = 'client', event = 'qb-police:client:openStash', icon = 'fas fa-dungeon', - label = 'Open Personal Stash', + label = Lang:t('target.open_personal_stash'), jobType = 'leo', }, }, @@ -740,7 +740,7 @@ if Config.UseTarget then type = 'client', event = 'qb-police:client:openTrash', icon = 'fas fa-trash', - label = 'Open Trash', + label = Lang:t('target.open_trash'), jobType = 'leo', }, }, @@ -760,7 +760,7 @@ if Config.UseTarget then type = 'client', event = 'qb-police:client:scanFingerPrint', icon = 'fas fa-fingerprint', - label = 'Open Fingerprint', + label = Lang:t('target.open_fingerprint'), jobType = 'leo', }, }, @@ -780,7 +780,7 @@ if Config.UseTarget then type = 'client', event = 'qb-police:client:openArmoury', icon = 'fas fa-gun', - label = 'Open Armory', + label = Lang:t('target.open_armory'), jobType = 'leo', }, }, @@ -800,7 +800,7 @@ if Config.UseTarget then type = 'client', event = 'police:client:EvidenceStashDrawer', icon = 'fas fa-dungeon', - label = 'Open Evidence Stash', + label = Lang:t('target.open_evidence_stash'), jobType = 'leo', }, }, diff --git a/locales/en.lua b/locales/en.lua index b2b17578..6f4d2717 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -26,7 +26,7 @@ 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' }, success = { uncuffed = 'You have been uncuffed', @@ -43,7 +43,7 @@ local Translations = { vehicle_flagged = 'Vehicle %{plate} has been flagged for %{reason}', impound_vehicle_removed = 'Vehicle taken out of impound!', impounded = 'Vehicle impounded', - }, + }, info = { mr = 'Mr.', mrs = 'Mrs.', @@ -116,7 +116,9 @@ local Translations = { new_call = 'New Call', 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...' + received_fine = 'State Debt Recovery has automatically recovered the fines owed...', + camera_speed= 'Speed camera #%{radarid} - Marked vehicle' + }, evidence = { red_hands = 'Red hands', @@ -188,6 +190,14 @@ local Translations = { remove_object = 'Removing object..', impound = 'Impounding Vehicle..', }, + target = { + sign_in = 'Sign In/Out service', + open_personal_stash = 'Open Personal Stash', + open_trash = 'Open Trash', + open_fingerprint = 'Open Fingerprint', + open_armory = 'Open Armory', + open_evidence_stash = 'Open Evidence Stash', + } } Lang = Lang or Locale:new({ diff --git a/locales/pt-br.lua b/locales/pt-br.lua index 6040d6fa..97a59d65 100644 --- a/locales/pt-br.lua +++ b/locales/pt-br.lua @@ -116,7 +116,8 @@ local Translations = { new_call = 'Nova Chamada', officer_down = 'Oficial %{lastname} | %{callsign} Ferido', fine_issued = 'Multa foi emitida para o infrator com sucesso', - received_fine = 'A Central de Recuperação de Dívidas Estaduais recuperou automaticamente as multas pendentes...' + received_fine = 'A Central de Recuperação de Dívidas Estaduais recuperou automaticamente as multas pendentes...', + camera_speed= 'Camera do radar marcou o veículo #%{radarid}' }, evidence = { red_hands = 'Mãos vermelhas', @@ -188,6 +189,14 @@ local Translations = { remove_object = 'Removendo Objeto...', impound = 'Apreendendo Veículo...', }, + target = { + sign_in = 'Entrada/Saída de serviço', + open_personal_stash = 'Abrir Compartimento Pessoal', + open_trash = 'Abrir Lixeira', + open_fingerprint = 'Abrir Impressão Digital', + open_armory = 'Abrir Arsenal', + open_evidence_stash = 'Abrir Esconderijo de Evidências', + } } diff --git a/server/main.lua b/server/main.lua index e83c40f1..3dcfccf7 100644 --- a/server/main.lua +++ b/server/main.lua @@ -232,8 +232,7 @@ QBCore.Commands.Add('unjail', Lang:t('commands.unjail_player'), { { name = 'id', local src = source local Player = QBCore.Functions.GetPlayer(src) if Player.PlayerData.job.type == 'leo' and Player.PlayerData.job.onduty then - local playerId = tonumber(args[1]) - TriggerClientEvent('prison:client:UnjailPerson', playerId) + TriggerClientEvent('prison:client:UnjailPerson', tonumber(args[1])) else TriggerClientEvent('QBCore:Notify', src, Lang:t('error.on_duty_police_only'), 'error') end