while
#3

I believe that you do not increase the value is used in while and it's an infinite loop; hence it makes the server to stop.

I'd recommend you to use for loop but in case you want to use while, it can also be done like:
pawn Код:
new
    i = -1;

// increasing i by 1 and it returns the new value - it basically starts as: while(0 < MAX_PLAYERS) and it is increased later on..
while (++i < MAX_PLAYERS)
{
    //do stuff here
}
Reply


Messages In This Thread
while - by audriuxxx - 21.12.2013, 17:30
Re: while - by Patrick - 21.12.2013, 17:39
Re: while - by Konstantinos - 21.12.2013, 18:01

Forum Jump:


Users browsing this thread: 2 Guest(s)