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

  1. Open esx_policejob/client/main.lua
  2. Find function OpenBodySearchMenu and remove it.
  3. Add this code:
function OpenBodySearchMenu(player)
	TriggerEvent("esx_inventoryhud:openPlayerInventory", GetPlayerServerId(player), GetPlayerName(player))
end