SA-MP Forums Archive
Finding 30% of Tax. (Maths.) - 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: Finding 30% of Tax. (Maths.) (/showthread.php?tid=324028)



Finding 30% of Tax. (Maths.) - Dokins - 07.03.2012

How do I get this to remove 30% of the value. Like so:

pawn Код:
subtotal = benefits + rank + onlinebonus + faction;
    taxtotal = subtotal / 100 * 30;
    total =  taxtotal;



Re: Finding 30% of Tax. (Maths.) - CAR - 07.03.2012

pawn Код:
subtotal = benefits + rank + onlinebonus + faction;
taxtotal = subtotal / 100 * 30;
total =  subtotal-taxtotal;
You forgot one thing...

You could also use this:
pawn Код:
subtotal = benefits + rank + onlinebonus + faction;
total = subtotal / 100 * 70;
Or this:
pawn Код:
total = (benefits + rank + onlinebonus + faction) / 100 * 70;



Re: Finding 30% of Tax. (Maths.) - Hiddos - 07.03.2012

Wondering if it's not this:
pawn Код:
total = taxtotal + subtotal;
Anyway, to remove 30% off something you just multiply it with 0.7 (70%).


Re: Finding 30% of Tax. (Maths.) - Dokins - 07.03.2012

Thanks guys!