div and mod
#1

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?
Reply
#2

May I ask what line is 3963?
Found out, this https://sampwiki.blast.hk/wiki/While.

Here BTW:
Код:
 while (a > 0)
Just try it.
Reply
#3

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
Reply
#4

while(a > 0)
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)