Other question about rent.
#1

Hey guys. I want that 0.2% rent is coming to my bank now.
I'll show you my bank system.
It is like this in a dialog:
Код:
if(dialogid == 5)
switch(listitem)
{
    case 0:
    {

    		if(GetPlayerMoney(playerid)>1)

       {
        PlayerInfo[playerid][Bank] += 1;
        GivePlayerMoney(playerid,-1);
        SendClientMessage(playerid,orange, "You putted 1 dollar to your bank");
        }
        else {
        SendClientMessage(playerid,orange, "You Don't Have Enough money");
        }
    }
So everytime the bank code is called "Bank"

Now you also can see your bank money at /stats.

But I want that you will get 0.2% rent your bank.
I only need the rent script. I will put it in my payday.
Please help me guys. Or tell me if you need more information
Reply
#2

nobody?XD
Reply
#3

For one, read the rules. No bumping till 12 hours.

And. let me find you a rent script.
Reply
#4

Set a timer for payday, loop through all registered accounts and set their bank cash amount to amount * 1.002
Reply
#5

Yea sorry :P
But it has to work on my bank system I just showed
Reply
#6

Well I know have this:
Код:
public PayDay()
{
  for(new i = 0; i < GetMaxPlayers(); i++)
  {
    if(IsPlayerConnected(i))
    {
      if(PlayerInfo[i][Exp] <= 5)
      {
      PlayerInfo[i][Exp] += 1;
      	GameTextForPlayer(i,"PayDay",1000,1);
      	GivePlayerMoney(i,1000);
      	new Cash = floatround(Cash/100*0.2,floatround_round);
			GivePlayerMoney(i,Cash);
      	if(PlayerInfo[i][Exp] >= 5){
      	SetPlayerScore(i,GetPlayerScore(i)+1);
      	GameTextForPlayer(i,"Age UP",1000,1);
      	PlayerInfo[i][Exp] = 0;
      	}
    }
  }
  }
}
But it is only giving 0.2% of 100.
I want that it gives 0.2 percent of the money you have.

And I want it to be on the bank so not the money you have in your hand.
i tought something like this:

public PayDay()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][Exp] <= 5)
{
PlayerInfo[i][Exp] += 1;
GameTextForPlayer(i,"PayDay",1000,1);
GivePlayerMoney(i,1000);
new Bank = floatround(Bank/100*0.2,floatround_round);
GivePlayerMoney(i,Bank);
if(PlayerInfo[i][Exp] >= 5){
SetPlayerScore(i,GetPlayerScore(i)+1);
GameTextForPlayer(i,"Age UP",1000,1);
PlayerInfo[i][Exp] = 0;
}
}
}
}
}


But well.
That's not it xD
Reply
#7

Why don't you just use
Код:
Bank*1.02
instead of
Код:
Bank/100*0.2
Then there is only 2 numbers, but i'm not sure (:
Reply
#8

pawn Код:
strval(Bank)*1.02
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)