Paycheck help. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Paycheck help. (
/showthread.php?tid=582579)
Paycheck help. -
IndependentGaming - 21.07.2015
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(string, sizeof(string), " Interest gained: $%s", number_format(interest));
SendClientMessage(i, COLOR_GRAD3, string);
SendClientMessage(i, COLOR_GRAD4, "|_______________________________________________|");
format(string, sizeof(string), " New balance: $%s | Rent paid: $%d", number_format(playerData[i][pDeposit]), (0 <= playerData[i][pRenting] < MAX_HOUSES) ? (houseData[playerData[i][pRenting]][h_iRentFee]) : (0));
SendClientMessage(i, COLOR_GRAD5, string);
Stands for 100 + or x the tax
so for example 100 X 10% tax is 200 % paycheck?
Re: Paycheck help. -
Mariciuc223 - 21.07.2015
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 .
Re: Paycheck help. -
IndependentGaming - 21.07.2015
So if i understand this i need to
edit this:
PHP код:
[pPayCheck] / 100
to get a lower or higher paycheck ?
Re: Paycheck help. -
IndependentGaming - 21.07.2015
bumb
Re: Paycheck help. -
Krokett - 21.07.2015
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.