partiusfabaa / cs2-LiteVIP

plugin for cs2 with basic functions VIP
20 stars 1 forks source link

Money code #21

Closed skaen closed 11 months ago

skaen commented 11 months ago

I edit the output as follows:

if (group.Money != null && !g_bPistolRound)
    if (group.Money.Value != -1)
        if (moneyServices != null)
        {
            var stringCvar = ConVar.Find("mp_maxmoney");
            var Balance = moneyServices.Account;
            var UpdateBalance = moneyServices.Account + group.Money.Value;

            if (UpdateBalance > stringCvar!.GetPrimitiveValue<int>())
            {
                Balance = stringCvar!.GetPrimitiveValue<int>();
            }
            else
            {
                Balance = UpdateBalance;
            }

            moneyServices.Account = Balance > 16000 ? 16000 : Balance;
        }
partiusfabaa commented 11 months ago

I edit the output as follows:

if (group.Money != null && !g_bPistolRound)
    if (group.Money.Value != -1)
        if (moneyServices != null)
        {
            var stringCvar = ConVar.Find("mp_maxmoney");
            var Balance = moneyServices.Account;
            var UpdateBalance = moneyServices.Account + group.Money.Value;

            if (UpdateBalance > stringCvar!.GetPrimitiveValue<int>())
            {
                Balance = stringCvar!.GetPrimitiveValue<int>();
            }
            else
            {
                Balance = UpdateBalance;
            }

            moneyServices.Account = Balance > 16000 ? 16000 : Balance;
        }

Not sure what your point is, but for me if mp_maxmoney was 16000, I just couldn't get more.