RegisterNetEvent('esx_ambulancejob:revive')
AddEventHandler('esx_ambulancejob:revive', function()
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
TriggerServerEvent('esx_ambulancejob:setDeathStatus', false)
-- local inMatchGame = exports.biyei_arenas:InMatch() or exports.biyei_arenas:InRankedMatch()
local inMatchGame = LocalPlayer.state.InMatch or LocalPlayer.state.InRankedMatch
DoScreenFadeOut(800)
while not IsScreenFadedOut() do
Wait(50)
end
local formattedCoords = {x = ESX.Math.Round(coords.x, 1), y = ESX.Math.Round(coords.y, 1), z = ESX.Math.Round(coords.z, 1)}
RespawnPed(playerPed, formattedCoords, 0.0)
isDead = false
ClearTimecycleModifier()
SetPedMotionBlur(playerPed, false)
ClearExtraTimecycleModifier()
EndDeathCam()
DoScreenFadeIn(800)
end)
โข STEP 6: Add function InMatch in your inventory
For ox_inventory or another inventory disable open in match
-- Open Inventory
-- ox_inventory/client.lua
local function canOpenInventory()
if exports.biyei_arenas:InMatch() or exports.biyei_arenas:InRankedMatch() then
return shared.info('cannot open inventory', '(in match)')
end
return true
end
--- Use Item
local function canUseItem(isAmmo)
local ped = cache.ped
if exports.biyei_arenas:InMatch() or exports.biyei_arenas:InRankedMatch() then
return shared.info('cannot open inventory', '(in match)')
end
end