I have an active item, by player.GetActiveItem() - I get the item id etc., so I can re-create that item as needed.
However, I would like to remove that item from the player first, how can I do that?
Thanks!
Removing an active item from a player?
Discussion in 'Rust Development' started by TheDoc, Jun 29, 2016.
-
You remove and handle it just like any other item. I assumed you wanted to completely get rid of the item, yes? If so, the above should do that.Code:
[ChatCommand("killheld")] private void cmdKillHeld(BasePlayer player, string command, string[] args) { var heldItem = player?.GetActiveItem() ?? null; if (heldItem != null) heldItem.RemoveFromContainer(); } -
That did the trick! Thanks!
