aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts
diff options
context:
space:
mode:
authorzxcPandora <81985226+zxcPandora@users.noreply.github.com>2023-01-25 00:58:53 +0800
committerGitHub <noreply@github.com>2023-01-24 17:58:53 +0100
commit9775ffb3b478a921f7d64d8907ab6c2b91128f40 (patch)
tree012ed6b2314c6a4dbd644a591bd554d152abd9e6 /Northstar.CustomServers/mod/scripts
parent9bbe6832460aaabd96fef18d6e4ebb05779bb71d (diff)
downloadNorthstarMods-9775ffb3b478a921f7d64d8907ab6c2b91128f40.tar.gz
NorthstarMods-9775ffb3b478a921f7d64d8907ab6c2b91128f40.zip
Add a function to take away all inventory item (#565)
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/item_inventory/sv_item_inventory.gnut11
1 files changed, 10 insertions, 1 deletions
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
+}