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
})
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