SA-MP Forums Archive
How to divide, and use it somewhere else? - 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: How to divide, and use it somewhere else? (/showthread.php?tid=148201)



How to divide, and use it somewhere else? - 0ne - 16.05.2010

title says it,

new result[64];
RACE_MONEY/20 = result;

how could i divide it by 20 and get the result without any errors cause I didn't do dividing in my script and now I'm just wondering how to do it?


Re: How to divide, and use it somewhere else? - Kyosaur - 16.05.2010

First of all, your using the wrong data type. It should be an integer instead of a string. Second how did you think


pawn Код:
RACE_MONEY/20 = result;
was logical at all lol. Its like your saying: 1 = 0. Doesnt Make sense. Here's how u need to do it.

pawn Код:
new result = RACE_MONEY/20;



Re: How to divide, and use it somewhere else? - 0ne - 16.05.2010

ok, thanks