Exemple #1
0
        //This thing is broke, dont use it
        public static void TransferToFactionAccount(long id, long factionID, Int64 amount)
        {
            MyAccountInfo account;

            // MyBankingSystem.Static.TryGetAccountInfo(factionID, out account);
            //      List<MyAccountLogEntry> Log = account.Log.ToList();
            //  MyAccountLogEntry entry = new MyAccountLogEntry()
            // {
            //    Amount = amount,
            //    DateTime = DateTime.Now,
            //    ChangeIdentifier = factionID
            // };
            // //Log.Add(entry);
            //MyAccountInfo account2 = account;
            // account2.Log = Log.ToArray();

            //    foreach (MyAccountLogEntry e in account.Log.ToList())
            //    {
            //     CrunchUtilitiesPlugin.Log.Info(e.Amount);
            //  }
            long factionBalance = EconUtils.getBalance(factionID) + amount;
            long playerBalance  = EconUtils.getBalance(id) - amount;

            CrunchUtilitiesPlugin.Log.Info("Ignore this error");
            // MyBankingSystem.RequestTransfer_BroadcastToClients(id, factionID, amount, id, factionID);
            //EconUtils.takeMoney(factionID, EconUtils.getBalance(factionID));
            //EconUtils.takeMoney(id, EconUtils.getBalance(id));
            //MyBankingSystem.ChangeBalance(factionID, factionBalance);
            //MyBankingSystem.ChangeBalance(id, playerBalance);

            MyBankingSystem.Static.SaveData();

            return;
        }
Exemple #2
0
        //This thing is broke, dont use it
        public static void TransferToFactionAccount(long id, long factionID, Int64 amount)
        {
            MyAccountInfo account;

            // MyBankingSystem.Static.TryGetAccountInfo(factionID, out account);
            //      List<MyAccountLogEntry> Log = account.Log.ToList();
            //  MyAccountLogEntry entry = new MyAccountLogEntry()
            // {
            //    Amount = amount,
            //    DateTime = DateTime.Now,
            //    ChangeIdentifier = factionID
            // };
            // //Log.Add(entry);
            //MyAccountInfo account2 = account;
            // account2.Log = Log.ToArray();

            //    foreach (MyAccountLogEntry e in account.Log.ToList())
            //    {
            //     CrunchUtilitiesPlugin.Log.Info(e.Amount);
            //  }
            EconUtils.addMoney(factionID, amount);
            EconUtils.takeMoney(id, amount);
            //MyBankingSystem.ChangeBalance(factionID, factionBalance);
            //MyBankingSystem.ChangeBalance(id, playerBalance);

            //MyBankingSystem.Static.SaveData();

            return;
        }