You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone, I'm having a very neurotic problem, running this code in my fivem ESX client-side I keep getting the message "you can't open this inventory" but I can't understand what's wrong having followed the documentation
function isPlayerDead(entity)
return Entity(entity).state and Entity(entity).state.isDead
end
exports.ox_target:addGlobalPlayer({
name = 'search_dead_player',
label = 'Search dead Player',
icon = 'fas fa-magnifying-glass',
distance = 3,
canInteract = function(entity, distance)
return isPlayerDead(entity)
end,
onSelect = function(data)
local targetPlayer = GetPlayerServerId(NetworkGetPlayerIndexFromPed(data.entity))
if not targetPlayer then return end
exports.ox_inventory:openInventory("player", targetPlayer)
end
})
The text was updated successfully, but these errors were encountered:
Ok as I said I had to intervene on the animations performed, I highly recommend including it in the documentation
local function canOpenTarget(ped)
return IsPedFatallyInjured(ped)
or IsEntityPlayingAnim(ped, 'dead', 'dead_a', 3)
or IsPedCuffed(ped)
or IsEntityPlayingAnim(ped, 'mp_arresting', 'idle', 3)
or IsEntityPlayingAnim(ped, 'missminuteman_1ig_2', 'handsup_base', 3)
or IsEntityPlayingAnim(ped, 'missminuteman_1ig_2', 'handsup_enter', 3)
or IsEntityPlayingAnim(ped, 'random@mugging3', 'handsup_standing_base', 3)
or IsEntityPlayingAnim(ped, 'combat@damage@writhe', 'writhe_loop', 3) <-- ADDED THIS
end
Hi everyone, I'm having a very neurotic problem, running this code in my fivem ESX client-side I keep getting the message "you can't open this inventory" but I can't understand what's wrong having followed the documentation
The text was updated successfully, but these errors were encountered: