From 9775ffb3b478a921f7d64d8907ab6c2b91128f40 Mon Sep 17 00:00:00 2001 From: zxcPandora <81985226+zxcPandora@users.noreply.github.com> Date: Wed, 25 Jan 2023 00:58:53 +0800 Subject: Add a function to take away all inventory item (#565) --- .../scripts/vscripts/item_inventory/sv_item_inventory.gnut | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut b/Northstar.CustomServers/mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut index d4ec58790..7d4552a0e 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut @@ -8,6 +8,7 @@ global function PlayerInventory_EndCriticalSectionForWeaponOnEndFrame global function PlayerInventory_PushInventoryItem global function PlayerInventory_PushInventoryItemByBurnRef global function PlayerInventory_PopInventoryItem +global function PlayerInventory_TakeAllInventoryItems global function PlayerInventory_CountBurnRef struct @@ -141,6 +142,14 @@ void function PlayerInventory_PopInventoryItem( entity player ) return } +void function PlayerInventory_TakeAllInventoryItems( entity player ) +{ + file.playerInventoryStacks[ player ].clear() + waitthread PlayerInventory_TakeInventoryItem( player ) + player.SetPlayerNetInt( "itemInventoryCount", 0 ) + return +} + void function PlayerInventory_RefreshEquippedState( entity player ) { @@ -154,4 +163,4 @@ void function PlayerInventory_StartCriticalSection( entity player ) void function PlayerInventory_EndCriticalSectionForWeaponOnEndFrame( entity weapon ) { -} \ No newline at end of file +} -- cgit v1.2.3