Paycheck help.
#1

Hello i was wondering if this:

PHP код:
playerData[i][pDeposit] -= (playerData[i][pPayCheck] / 100) * g_iTaxValue;
>>>            
g_iTax += (playerData[i][pPayCheck] / 100) * g_iTaxValue;
            
playerData[i][pDeposit] += interest;
            
format(stringsizeof(string), "  Interest gained: $%s"number_format(interest));
            
SendClientMessage(iCOLOR_GRAD3string);
            
SendClientMessage(iCOLOR_GRAD4"|_______________________________________________|");
            
format(stringsizeof(string), "  New balance: $%s  |  Rent paid: $%d"number_format(playerData[i][pDeposit]), (<= playerData[i][pRenting] < MAX_HOUSES) ? (houseData[playerData[i][pRenting]][h_iRentFee]) : (0));
            
SendClientMessage(iCOLOR_GRAD5string); 
Stands for 100 + or x the tax

so for example 100 X 10% tax is 200 % paycheck?
Reply
#2

if you need a interest gained of 0.1 or 0.2 % , you need to calculate (0.1 / 100) * PlayerCash (that have in bank) before you give that money to him , hope that you need .
Reply
#3

So if i understand this i need to

edit this:
PHP код:
[pPayCheck] / 100 
to get a lower or higher paycheck ?
Reply
#4

bumb
Reply
#5

Not sure if I understand you, but this is basic maths.

This: g_iTax += (playerData[i][pPayCheck] / 100) * g_iTaxValue;

Let's say playerData[i][pPayCheck] = 250$ and g_iTaxValue = 20%, so the player receives 250$ and needs to pay 20% of the 250$.

So the result will be: 50 += (250 / 100) * 20.

Depending on the g_iTaxValue, you can set it higher to lower his paycheck, or set it lower to give him a bigger paycheck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)