Government Taxes
#1

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?
Reply
#2

Anyone?
Reply
#3

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.
Reply
#4

You mean getting the information in-game or doing calculations or whatever?
Reply
#5

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.
Reply
#6

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.
Reply
#7

It seems to be in working order, thanks mate!
Reply
#8

No problem, glad to see it worked out for you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)