div and mod - 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: div and mod (
/showthread.php?tid=267504)
div and mod -
marrcko - 08.07.2011
pawn Код:
stock DIV(playerid,a,b)
{
sveikas[playerid]=0;
while a > 0
{ // <<<<<<<<<<<<< this line
a = a - b;
sveikas[playerid]++;
}
return sveikas[playerid];
}
stock MOD(playerid,a,b)
{
liekana[playerid]=0;
liekana[playerid] =a - DIV(playerid,a,b)* b;
return liekana[playerid];
}
Hi, as u see i'm trying to create div and mod stucks (functions witch are in java, pascal and etc.)
but i get error
Код:
E:\Smth\samp\free roam\gamemodes\freeroam.pwn(3963) : error 029: invalid expression, assumed zero
So any help?
Re: div and mod - Guest3598475934857938411 - 08.07.2011
May I ask what line is 3963?
Found out, this
https://sampwiki.blast.hk/wiki/While.
Here BTW:
Just try it.
Re: div and mod -
marrcko - 08.07.2011
i marked it as
<<<<<<<<<<this line @script (and yes, its realy that line)
but thx for link...After looking it i noted that ( ) is mising
LOL
Re: div and mod -
Macluawn - 08.07.2011
while
(a > 0
)
Re: div and mod - Guest3598475934857938411 - 08.07.2011
No problem helping you at all, after a bit I posted the solution
I didn't post with my first time due I don't want you being lazy and with every problem you get you post us the errors and we fix it.