Infinite loop that freezes the server
#1

Hello,
I have a problem with infinite loops. Where do you think is the cause of infinite loop here:
PHP код:
public SpeedoUpdate()
{
    for(new 
0GetPlayerPoolSize(); <= ji++)
    {
        if(
IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            new 
Float:xFloat:yFloat:zFloat:hpstring[24], vehicleid GetPlayerVehicleID(i);
            if(
Speedo[i] == 0)
            {
                
TextDrawShowForPlayer(ivspeed[i]);
                if(
GetVehicleModel(vehicleid) != 509 && GetVehicleModel(vehicleid) != 481 && GetVehicleModel(vehicleid) != 510)
                {
                    
TextDrawShowForPlayer(ivhealth[i]);
                }
            }
            
GetVehicleVelocity(vehicleidxyz);
            
GetVehicleHealth(vehicleidhp);
            if(
Kmhmph[i] == 0)
            {
                
format(stringsizeof(string), "Speed: %dkm/h"floatround(floatsqroot(((x*x)+(y*y))+(z*z))*180.666667));
                
TextDrawSetString(vspeed[i], string);
                
TextDrawBackgroundColor(vspeed[i], 369098796);
                
TextDrawFont(vspeed[i], 2);
                
TextDrawLetterSize(vspeed[i], 0.3499991.299996);
                
TextDrawColor(vspeed[i], 0xC3C3C3FF);
                
TextDrawSetOutline(vspeed[i], 1);
                
TextDrawSetProportional(vspeed[i], 1);
            }
            if(
Kmhmph[i] == 1)
            {
                
format(stringsizeof(string), "Speed: %dm/s"floatround(floatsqroot(((x*x)+(y*y))+(z*z))*86.666667));
                
TextDrawSetString(vspeed[i], string);
                
TextDrawBackgroundColor(vspeed[i], 369098796);
                
TextDrawFont(vspeed[i], 2);
                
TextDrawLetterSize(vspeed[i], 0.3499991.299996);
                
TextDrawColor(vspeed[i], 0xC3C3C3FF);
                
TextDrawSetOutline(vspeed[i], 1);
                
TextDrawSetProportional(vspeed[i], 1);
            }
            
format(stringsizeof(string), "Health: %d"floatround(hp));
            
TextDrawSetString(vhealth[i], string);
            
TextDrawBackgroundColor(vhealth[i], 369098796);
            
TextDrawFont(vhealth[i], 2);
            
TextDrawLetterSize(vhealth[i], 0.3499991.299996);
            
TextDrawColor(vhealth[i], 0xC3C3C3FF);
            
TextDrawSetOutline(vhealth[i], 1);
            
TextDrawSetProportional(vhealth[i], 1);
            if(
Speedo[i] == 1)
            {
                
TextDrawHideForPlayer(ivspeed[i]);
                
TextDrawHideForPlayer(ivhealth[i]);
            }
        }
        if(!
IsPlayerInAnyVehicle(i))
        {
            
TextDrawHideForPlayer(ivspeed[i]);
            
TextDrawHideForPlayer(ivhealth[i]);
        }
    }

and
PHP код:
public Production()
{
    for(new 
0GetPlayerPoolSize(); <= ji++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
pusedrug[i] == 1) {
            
SetPlayerArmedWeapon(i9);
            
SetPlayerWeather(i19); }
            if(
pusedrug[i] == 2) {
            
SetPlayerArmedWeapon(i9);
            
SetPlayerWeather(i, -74); }
            if(
pusedrug[i] == 3) {
            
SetPlayerArmedWeapon(i9);
            
SetPlayerWeather(i9); }
            if(
pusedrug[i] == 4) {
            
SetPlayerArmedWeapon(i9);
            
SetPlayerWeather(i, -130); }
        }
    }

Reply


Messages In This Thread
Infinite loop that freezes the server - by AliveBG - 22.05.2015, 09:44
Re: Infinite loop that freezes the server - by Konstantinos - 22.05.2015, 09:46
Re: Infinite loop that freezes the server - by AliveBG - 22.05.2015, 10:02
Re: Infinite loop that freezes the server - by Konstantinos - 22.05.2015, 10:08
Re: Infinite loop that freezes the server - by AliveBG - 22.05.2015, 10:12
Re: Infinite loop that freezes the server - by Konstantinos - 22.05.2015, 10:24
Re: Infinite loop that freezes the server - by RaeF - 22.05.2015, 10:50
Re: Infinite loop that freezes the server - by AliveBG - 22.05.2015, 10:55
Re: Infinite loop that freezes the server - by RaeF - 22.05.2015, 11:06
Re: Infinite loop that freezes the server - by AliveBG - 22.05.2015, 11:21

Forum Jump:


Users browsing this thread: 1 Guest(s)