This is creating an infinite loop, Why?
#1

I realized after looking at samp wikipedia that my server was restarting and this was causing it, I checked by removing it and I can confirm, this is an infinite loop, but my knowledge does not understand it as far as to how it is. Can anyone explain how it is and how to fix it?

pawn Код:
public UpdateTime()
{
    new mins,hour,secs;
    new time = gettime(hour,mins,secs);
    SetWorldTime(hour+4);

    format(timestr,32,"%02d:%02d",hour, mins);
    TextDrawSetString(txtTimeDisp,timestr);
   

    new x= time;
    while(x != MAX_PLAYERS)
    {
        if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE)
        {
            SetPlayerTime(x,hour,mins);
         }
        if(mins == 0)
        {
            doPayDay(x);
        }
         x++;
    }
}
Reply


Messages In This Thread
This is creating an infinite loop, Why? - by Dokins - 24.01.2012, 19:28
Re: This is creating an infinite loop, Why? - by [XST]O_x - 24.01.2012, 19:32
Re: This is creating an infinite loop, Why? - by Dokins - 24.01.2012, 19:40
Respuesta: Re: This is creating an infinite loop, Why? - by kirk - 24.01.2012, 19:44
Re: Respuesta: Re: This is creating an infinite loop, Why? - by [XST]O_x - 24.01.2012, 19:48
Respuesta: Re: Respuesta: Re: This is creating an infinite loop, Why? - by kirk - 24.01.2012, 20:38

Forum Jump:


Users browsing this thread: 2 Guest(s)