Anyone know this
#1

My question is; How will I make a system when player put's money in bank they will get interest by every 10 mins
Reply
#2

First you need to create a bank system, using dini or y_ini (anyone works). Later, on the money deposit command, you need to put an array to get the value, and depending of this value, set a timer for every 10minutes:

Example:
pawn Код:
blackwave: has used the command /deposit 2000 !
pawn Код:
forward GiveBack(playerid); // script top
new array,interest; // Recommended to be on top
array = 2000 // On the /deposit command
interest = array * 20 // Depending value. In this case it's 2000 x 20
SetTimerEx("GiveBack",600000,false,"i",playerid); // 600000ms = 10min
pawn Код:
public GiveBack(playerid)
{
    GivePlayerMoney(playerid, interest);
    // Depending a string, you might create one to check the interest value
    return 1;
Reply
#3

how will I make an interest value. I am weak at maths
Reply
#4

Dude, I gave a example. Interest = value * 20. Example:

Код:
 I put 20 $ on my bank account. The intereset will be 20x20 = 400
Simply.
Reply
#5

Quote:
Originally Posted by Jordan Smith
Посмотреть сообщение
how will I make an interest value. I am weak at maths
Not to be a douche but being weak in maths won't get you far in programming...
Reply
#6

[OFFTOPIC]
Instead of forwarding/public for callbacks you can use this:

pawn Код:
#define CB:%0(%1) forward %0(%1); public %0(%1)
So it will be like this:
pawn Код:
CB:GiveBack(playerid)
{
    // Do something
    return 1;
}
instead of
pawn Код:
forward GiveBack(playerid);
public GiveBack(playerid)
{
    // Do something
    return 1;
}
Someone made this before, but idk who anymore. And I am using this for a long time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)