Tree exchange for a stone (С#)
Discussion in 'Rust Development' started by ios, Mar 25, 2016.
-
If your looking for code to help you, you can use this for example.
Code:[ChatCommand("trade")] void TradeWood(Baseplayer player) { int StoneAmount = 100; int wood = player.inventory.GetAmount(3655341); int stone = player.inventory.GetAmount(-892070738); int MinWood = 1000; if(wood >= MinWood) { player.inventory.GiveItem(ItemManager.CreateByItemID(stone, StoneAmount)); } else { SendReply(player, "Not Enough Wood, you need "+MinWood+ " wood."); } } -
thanks
-
You'll also need a take for it, player.inventory.Take(stone, stone - StoneAmount);
