Example #1
0
        private void GiveSelf(NetUser netuser, ItemDataBlock data, int amount)
        {
            PlayerInventory inv = netuser.playerClient.rootControllable.idMain.GetComponent <PlayerInventory>();

            inv.AddItemAmount(data, amount);
            rust.SendChatMessage(netuser, "You gave yourself (" + data.ToString() + ") (" + amount + ")");
        }
Example #2
0
        private void GiveItem(NetUser netuser, NetUser target, ItemDataBlock data, int amount)
        {
            PlayerInventory inv = target.playerClient.rootControllable.idMain.GetComponent <PlayerInventory>();

            inv.AddItemAmount(data, amount);
            rust.SendChatMessage(netuser, "You gave (" + data.ToString() + ") (" + amount + ") to " + target.displayName);
        }