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


Messages In This Thread
div and mod - by marrcko - 08.07.2011, 18:49
Re: div and mod - by Guest3598475934857938411 - 08.07.2011, 18:50
Re: div and mod - by marrcko - 08.07.2011, 18:55
Re: div and mod - by Macluawn - 08.07.2011, 18:58
Re: div and mod - by Guest3598475934857938411 - 08.07.2011, 19:00

Forum Jump:


Users browsing this thread: 1 Guest(s)