Heavy CPU usage...
#9

So to replace my loop with foreach ?
EDIT:
changed it to this
pawn Код:
if(!BoomboxStream[playerid])
    {
        foreach(new i : Player)
        {
            if(Boombox[i])
            {
                if(IsPlayerInRangeOfPoint(playerid, 30, bpos[i][0], bpos[i][1], bpos[i][2]))
                {
                PlayAudioStreamForPlayer(playerid, BoomboxURL[i], bpos[i][0], bpos[i][1], bpos[i][2], 30, 1);
                BoomboxPlayer[playerid] = i;
                BoomboxStream[playerid] = 1;
                SendClientMessage(playerid, COLOR_GREY, " You are listening to music coming out of a nearby boombox.");
                }
            }
        }
    }
    else
    {
        new i = BoomboxPlayer[playerid];
        if(!IsPlayerInRangeOfPoint(playerid, 30, bpos[i][0], bpos[i][1], bpos[i][2]))
        {
            BoomboxStream[playerid] = 0;
            BoomboxPlayer[playerid] = -1;
            StopAudioStreamForPlayer(playerid);
            SendClientMessage(playerid, COLOR_GREY, " You have went far away from the boombox.");
        }
    }
I'm going to sleep now..so dicuss and try to help my fucking CPU usage :/...good night.
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: 5 Guest(s)