Heavy CPU usage...
#8

Quote:
Originally Posted by The__
Посмотреть сообщение
How about this loop ?
pawn Код:
for(new i, j = GetMaxPlayers(); i < j; i++)
I looked back, and this whole code doesn't even works well.
PHP код:
    if(!BoomboxStream[playerid])
    {
        for(new 
i=0i<MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
Boombox[i])
                {
                    if(
IsPlayerInRangeOfPoint(playerid30bpos[i][0], bpos[i][1], bpos[i][2]))
                    {
                        
PlayAudioStreamForPlayer(playeridBoomboxURL[i], bpos[i][0], bpos[i][1], bpos[i][2], 301);
                        
BoomboxPlayer[playerid] = i;
                        
BoomboxStream[playerid] = 1;
                        
SendClientMessage(playeridCOLOR_GREY" You are listening to music coming out of a nearby boombox.");
                    }
                }
            }
        }
    }
    else
    {
        new 
BoomboxPlayer[playerid];
        if(!
IsPlayerInRangeOfPoint(playerid30bpos[i][0], bpos[i][1], bpos[i][2]))
        {
            
BoomboxStream[playerid] = 0;
            
BoomboxPlayer[playerid] = -1;
            
StopAudioStreamForPlayer(playerid);
            
SendClientMessage(playeridCOLOR_GREY" You have went far away from the boombox.");
        }
    } 
Reply


Messages In This Thread
Heavy CPU usage... - by The__ - 27.12.2012, 05:10
Re: Heavy CPU usage... - by The__ - 27.12.2012, 15:04
Re: Heavy CPU usage... - by Gh05t_ - 27.12.2012, 15:08
Re: Heavy CPU usage... - by Hiddos - 27.12.2012, 15:12
Re: Heavy CPU usage... - by The__ - 27.12.2012, 15:12
Re: Heavy CPU usage... - by BlackBank - 27.12.2012, 16:11
Re: Heavy CPU usage... - by The__ - 27.12.2012, 16:39
Re: Heavy CPU usage... - by BlackBank - 27.12.2012, 20:12
Re: Heavy CPU usage... - by The__ - 27.12.2012, 20:15
Re: Heavy CPU usage... - by The__ - 28.12.2012, 04:49

Forum Jump:


Users browsing this thread: 6 Guest(s)