Math in a variable - 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: Math in a variable (
/showthread.php?tid=210957)
Math in a variable -
Biesmen - 14.01.2011
Hello,
I'm working on a simple calculation. But I cannot get it work in a variable.
I tried the following methods. All the time I will get an argument mismatch error/warning if I use the variable at 'GivePlayerMoney'.
pawn Код:
new Calculation = COwnerData[i][Price] * 0.85;
I also tried braces.
pawn Код:
new Float:Calculation = COwnerData[i][Price] * 0.85;
I also tried format, didn't work out.
Re: Math in a variable -
JamesC - 14.01.2011
pawn Код:
new
Calculation = floatround( floatmul( COwnerData[i][Price], 0.85 ), floatround_ceil );
;
Untested.