예제 #1
0
파일: EconAPI.cs 프로젝트: gulelat/Economy
 // 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);
             }
         }
     }
 }
예제 #2
0
파일: EconAPI.cs 프로젝트: gulelat/Economy
 // 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);
             }
         }
     }
 }
예제 #3
0
파일: EconAPI.cs 프로젝트: gulelat/Economy
        // 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));
        }
예제 #4
0
파일: EconAPI.cs 프로젝트: gulelat/Economy
        // 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));
        }
예제 #5
0
파일: EconAPI.cs 프로젝트: gulelat/Economy
        // 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));
        }