Infinite Loop!
#1

Hello,

Anybody knows a quick method to find an infinte loop?
Please tell me,anything that you know about it..
Reply
#2

Look at your while loops and for, you should count the iterations, if over x, stop it.
Reply
#3

search on ******

It is not necessary to use endless iterations
Reply
#4

Add print before loop, add print after loop. If the server hangs, you'll know.
Reply
#5

I think that i will check all my loops,because this infinte loop comes rarely out..
Anyway if anybody has got a better solution,don't forget to tell me!
Reply
#6

Look for i++ while for do

The term will not have MAX_PLAYERS or MAX_VEHICLES.

Start looking for the function that starts the loop.
Reply
#7

Thanks for the answers,but i can't find it with my eyes..Any new ideas?
Reply
#8

Is this stock a problem?:
pawn Код:
stock date(timestamp, &f_day, &f_month, &f_year, &f_hour, &f_min, &f_sec)
{
    new s_year=1970, s_day=0, s_month=0, s_hour=0, s_mins=0;
    new days_of_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

    while(timestamp > 31622400)
    {
        timestamp -= 31536000;
        if(((s_year % 4 == 0) && (s_year % 100 != 0)) || (s_year % 400 == 0))  timestamp -= 86400;
        s_year++;
    }

    if(((s_year % 4 == 0) && (s_year % 100 != 0)) || (s_year % 400 == 0))
    {
        days_of_month[1] = 29;
    }
    else
    {
        days_of_month[1] = 28;
    }

    while(timestamp > 86400)
    {
        timestamp -= 86400, s_day++;
        if(s_day == days_of_month[s_month]) s_day=0, s_month++;
    }

    while(timestamp>60)
    {
        timestamp -= 60, s_mins++;
        if(s_mins == 60) s_mins=0, s_hour++;
    }

    f_day = s_day + 1;
    f_month = s_month + 1;
    f_year = s_year;
    f_hour = s_hour;
    f_min = s_mins;
    f_sec = timestamp;

    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)