Build interest

Hey eclipse community,

I just got an idea, i think it had been done before, but i got this idea on my own… but i’m going to need some help…

i want to make it like this:

  • If player has money in the bank Then

  • add 4% of total money in the bank every 2 weeks

im not a great coder, so i don’t know how to convert that into a working Vb6 code.

Please help me, i would love to have this on my server

This is just psuedo code but it should be easily adaptable; it’s pretty inefficient but it’ll do:


For i = 1 to MAX_PLAYERS

    If Player(i).BankTmr < Tick Then

	    For j = 1 to MAX_BANK_ITEMS

			  If Player(i).BankItem(j).Item = MoneyIndex and HasBeenInFor2Weeks(Player(i).BankItem(j)) Then

				   Player(i).BankItem(j).Num = Player(i).BankItem(j).Num + (Player(i).Bankitem(j).Num * 0.04)

				   Exit For

			  End if

	    Next

	    Player(i).BankTmr = Tick + SomeAmountOfSeconds

    End if

Next

The HasBeenInFor2Weeks calculation would just involve incrementing a day counter based on a timer I guess.

Log in to reply