From c3665e8981a673471f04e049c026d7ef8c9dc2d6 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:06:55 +0100 Subject: [PATCH] chore: (bpt_policejob) introduces the prison menu to the police f6 menu --- .../[bpt_addons]/bpt_policejob/client/main.lua | 17 +++++++++++++++-- .../[bpt_addons]/bpt_policejob/locales/en.lua | 2 ++ .../[bpt_addons]/bpt_policejob/locales/it.lua | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_policejob/client/main.lua b/server-data/resources/[bpt_addons]/bpt_policejob/client/main.lua index 1b67c9e79..f72d14681 100644 --- a/server-data/resources/[bpt_addons]/bpt_policejob/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_policejob/client/main.lua @@ -229,6 +229,7 @@ function OpenPoliceActionsMenu() { icon = "fas fa-idkyet", title = TranslateCap("fine"), value = "fine" }, { icon = "fas fa-idkyet", title = TranslateCap("weapon"), value = "weapon" }, { icon = "fas fa-idkyet", title = TranslateCap("unpaid_bills"), value = "unpaid_bills" }, + { icon = "fas fa-object", title = TranslateCap("jail_menu"), value = "jail_menu" }, } if Config.EnableLicenses then @@ -269,6 +270,8 @@ function OpenPoliceActionsMenu() ShowPlayerLicense(closestPlayer) elseif action == "unpaid_bills" then OpenUnpaidBillsMenu(closestPlayer) + elseif action == "jail_menu" then + TriggerEvent("esx-qalle-jail:openJailMenu") end else ESX.ShowNotification(TranslateCap("no_players_nearby")) @@ -381,6 +384,16 @@ function OpenPoliceActionsMenu() end) end +function OpenJailMenu(data, menu) + if data.current.value == "jail_menu" then + TriggerEvent("esx-qalle-jail:openJailMenu") + end + + if data.current.value == "citizen_interaction" then + OpenPoliceActionsMenu() + end +end + function OpenIdentityCardMenu(player) ESX.TriggerServerCallback("bpt_policejob:getOtherPlayerData", function(data) local elements = { @@ -870,7 +883,7 @@ AddEventHandler("bpt_policejob:hasEnteredEntityZone", function(entity) local _ = GetEntityCoords(playerPed) if IsPedInAnyVehicle(playerPed, false) then - local vehicle = GetVehiclePedIsIn(playerPed) + local vehicle = GetVehiclePedIsIn(playerPed, false) for i = 0, 7, 1 do SetVehicleTyreBurst(vehicle, i, true, 1000) @@ -896,7 +909,7 @@ AddEventHandler("bpt_policejob:handcuff", function() Wait(100) end - TaskPlayAnim(playerPed, "mp_arresting", "idle", 8.0, -8, -1, 49, 0, 0, 0, 0) + TaskPlayAnim(playerPed, "mp_arresting", "idle", 8.0, -8, -1, 49, 0, false, false, false) RemoveAnimDict("mp_arresting") SetEnableHandcuffs(playerPed, true) diff --git a/server-data/resources/[bpt_addons]/bpt_policejob/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_policejob/locales/en.lua index 0f55a26ec..48c4f32bc 100644 --- a/server-data/resources/[bpt_addons]/bpt_policejob/locales/en.lua +++ b/server-data/resources/[bpt_addons]/bpt_policejob/locales/en.lua @@ -165,4 +165,6 @@ Locales["en"] = { ["society_police"] = "Police", ["received_firearms_license"] = "You have received your firearms license", ["released_gun_licence"] = "you have issued your gun licence", + -- Jail + ["jail_menu"] = "Jail menu", } diff --git a/server-data/resources/[bpt_addons]/bpt_policejob/locales/it.lua b/server-data/resources/[bpt_addons]/bpt_policejob/locales/it.lua index 4c8f2b7aa..e0dd45fe8 100644 --- a/server-data/resources/[bpt_addons]/bpt_policejob/locales/it.lua +++ b/server-data/resources/[bpt_addons]/bpt_policejob/locales/it.lua @@ -163,4 +163,6 @@ Locales["it"] = { ["weapon"] = "Porto D'armi", ["received_firearms_license"] = "Hai ricevuto il porto d'armi", ["released_gun_licence"] = "Hai rilasciato il porto d'armi", + -- Jail + ["jail_menu"] = "Menu Carcere", }