Open player inventory using InventoryHUD (esx_policejob etc.) - Trsak/esx_inventoryhud GitHub Wiki
To open player inventory, simply call client event:
From server:
TriggerClientEvent("esx_inventoryhud:openPlayerInventory", sourcePlayer, targetPlayer, targetPlayerName)
From client:
TriggerEvent("esx_inventoryhud:openPlayerInventory", targetPlayer, targetPlayerName)
Parameters:
- sourcePlayer - Server ID of player that opens inventory
- targetPlayer - Server ID of player who's inventory is displayed as second
- targetPlayerName - Name of that player
esx_policejob example
- Open
esx_policejob/client/main.lua
- Find function
OpenBodySearchMenu
and remove it. - Add this code:
function OpenBodySearchMenu(player)
TriggerEvent("esx_inventoryhud:openPlayerInventory", GetPlayerServerId(player), GetPlayerName(player))
end