From 0e700dfcc7988a59bffe73e7bcb1f989fcf9bcc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=20Gerg=C5=91?= Date: Tue, 24 Jan 2023 19:50:34 +0100 Subject: [PATCH] new esx:pauseMenuActive handler --- [core]/es_extended/client/modules/actions.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/[core]/es_extended/client/modules/actions.lua b/[core]/es_extended/client/modules/actions.lua index aecda7f9..121f3f3a 100644 --- a/[core]/es_extended/client/modules/actions.lua +++ b/[core]/es_extended/client/modules/actions.lua @@ -1,4 +1,4 @@ -local isInVehicle, isEnteringVehicle, isJumping = false, false, false +local isInVehicle, isEnteringVehicle, isJumping, inPauseMenu = false, false, false, false local currentVehicle, currentSeat = 0, 0 local playerPed = PlayerPedId() @@ -33,6 +33,15 @@ CreateThread(function() isJumping = false end + if IsPauseMenuActive() and not inPauseMenu then + inPauseMenu = true + TriggerEvent('esx:pauseMenuActive', inPauseMenu) + elseif not IsPauseMenuActive() and inPauseMenu then + inPauseMenu = false + TriggerEvent('esx:pauseMenuActive', inPauseMenu) + end + + if not isInVehicle and not IsPlayerDead(PlayerId()) then if DoesEntityExist(GetVehiclePedIsTryingToEnter(playerPed)) and not isEnteringVehicle then -- trying to enter a vehicle!