// buyItem(ItemName, Amount) /// <summary> /// This function purchases the specified Item. /// </summary> /// <param name="ItemName">EcoMod ItemName</param> public static void buyItem(string ItemName, int Amount) { foreach (SellableItem Item in sellableItems) { if (Item.Name == ItemName) { Player EcoPlayer = PlayerAPI.getPlayer(SEMod.playerName); if (EcoPlayer.Balance >= (Amount * Item.Price)) { EcoPlayer.Balance = EcoPlayer.Balance - (Amount * Item.Price); //EcoPlayer.Inventory.Add(GameItem Item, int Amount); } } } }
// buyItem(ItemName) /// <summary> /// This function purchases the specified Item. /// </summary> /// <param name="ItemName">EcoMod ItemName</param> public static void buyItem(string ItemName) { foreach (SellableItem Item in SellingAPI.sellableItems) { if (Item.Name == ItemName) { Player EcoPlayer = PlayerAPI.getPlayer(SEMod.playerName); if (EcoPlayer.Balance >= Item.Price) { EcoPlayer.Balance = EcoPlayer.Balance - Item.Price; //EcoPlayer.Inventory.Add(GameItem Item); } } } }
// getBalance(Player) /// <summary> /// This function gets the balance for the specified Player. /// </summary> /// <param name="Player">EcoMod Player</param> /// <returns>Balance of the Player</returns> internal static decimal getBalance(string Player) { Player EcoPlayer = PlayerAPI.getPlayer(SEMod.playerName); return(Convert.ToDecimal(EcoPlayer.Balance)); }
// getBalance(UID) /// <summary> /// This function gets the balance for the specified Player. /// </summary> /// <param name="UID">EcoMod UID</param> /// <returns>Balance of the Player</returns> internal static decimal getBalance(int UID) { Player EcoPlayer = PlayerAPI.getPlayer(UID); return(Convert.ToDecimal(EcoPlayer.Balance)); }
// getBalance() /// <summary> /// This function gets the balance for the current Player (Self). /// </summary> /// <returns>Balance of the current Player (Self)</returns> public static decimal getBalance() { Player EcoPlayer = PlayerAPI.getPlayer(SEMod.playerName); return(Convert.ToDecimal(EcoPlayer.Balance)); }