EmptyPlayerInventory
Takes every item the player holds - or all but what they wear.
SetPlayerInventory with an empty list: everything the player’s last report held is taken. With keepWorn the
clothing, armour and weapons they wear (GetPlayerEquipment) stay on them and only the rest goes. The money stays -
take it with GivePlayerMoney (GivePlayerMoney(pid, -GetPlayerMoney(pid))).
Syntax
Section titled “Syntax”EmptyPlayerInventory(pid [, keepWorn])| Parameter | Type | |
|---|---|---|
pid |
number | the player |
keepWorn |
boolean | true leaves what they wear on them (optional) |
Returns
Section titled “Returns”boolean - false when not connected
Example
Section titled “Example”-- a hardcore server: everything stays on the corpse, the player comes back with nothingfunction OnPlayerCorpse(pid, corpse) SetCorpseItems(corpse, GetPlayerInventory(pid)) EmptyPlayerInventory(pid) GivePlayerMoney(pid, -GetPlayerMoney(pid))endSee also
Section titled “See also”SetPlayerInventory · OnPlayerCorpse · GivePlayerMoney · the Items and inventory group of the index
