new esx:pauseMenuActive handler

This commit is contained in:
P Gergő
2023-01-24 19:50:34 +01:00
parent ee730ee036
commit 0e700dfcc7
+10 -1
View File
@@ -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!