Government Taxes - 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: Government Taxes (
/showthread.php?tid=583615)
Government Taxes -
Luis- - 29.07.2015
Right, I have a database that stores government information such as, player tax & business tax, both taxes have the current tax rate, example; the player tax is currently 5%. How would I go about making this work in pawn?
Re: Government Taxes -
Luis- - 29.07.2015
Anyone?
Re: Government Taxes -
DarkLored - 29.07.2015
Use online converters or try to do the math.
for example if you divide 500 by 200 you'll only pay 2.5 dollars for tax it really depends on the balance.
Re: Government Taxes -
Abagail - 29.07.2015
You mean getting the information in-game or doing calculations or whatever?
Re: Government Taxes -
Luis- - 29.07.2015
I just need the calculation for it, I'm no good with this sort of stuff. Would I divide the percent of the tax by the amount of money the player receives on a payday?
Quote:
Originally Posted by Abagail
You mean getting the information in-game or doing calculations or whatever?
|
I've got the information from the MySQL database, I just need to get it working, sadly I've no idea how to do that, I have no idea what calculations I should use.
Re: Government Taxes -
Abagail - 29.07.2015
You can probably find a formula and simply change it to use SA-MP functions and the numbers you have from the internet but something such as this should suffice:
pawn Код:
stock CalculateTax(taxpercent, playerpayday)
{
return floatround(playerpayday / 100 * taxpercent);
}
This should work, you can search "tax calculator" or something to verify if it calculates properly or not.
Re: Government Taxes -
Luis- - 29.07.2015
It seems to be in working order, thanks mate!
Re: Government Taxes -
Abagail - 29.07.2015
No problem, glad to see it worked out for you