Percentage in my GM - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Percentage in my GM (
/showthread.php?tid=242043)
Percentage in my GM -
Sujer - 19.03.2011
Hi, I'm looking for a percentage system or something like that because I'm working in a /sellcar command, that makes the vehicle dissapear, and the money for the player, is the 65% of the real money that is in other public.
That's not my problem. My problem is i want to give the player, te 65% of the CarDealer.
I try with this, but in compiling i receive a "tag mismatch" message:
pawn Код:
GivePlayerMoney(playerid, (CostoCocheComprable(vehicleid)) / 1.53);
Re: Percentage in my GM -
woot - 19.03.2011
https://sampwiki.blast.hk/wiki/Floatround
Re: Percentage in my GM -
Biesmen - 19.03.2011
pawn Код:
new PercentCalc = floatround( floatmul(CostoCocheComprable(vehicleid), 0.65 ), floatround_ceil ); //Calculating percentages is always "percentage/100". Which makes 65% 0.65.
GivePlayerMoney(playerid, PercentCalc);
Re: Percentage in my GM -
Sujer - 19.03.2011
I already fix it doing this:
pawn Код:
GivePlayerMoney(playerid, (CostoCocheComprable(vehicleid)) * 65 / 100);