Issue with loop causing lag.
#10

Quote:
Originally Posted by 0x88
Посмотреть сообщение
Код:
SendToAdmins(color, Message[])
{
	foreach(new i : Player)
	{
	      if(!IsPlayerAdmin(i)) continue;
	      SCM(i, color, Message);
	}
	return 1;
}
Replace the red text with the variable you want to name as the admin
I'll try this dude let see hope it help.

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Try this,
Works perfect for me.
Код:
for(new a=0;a<MAX_PLAYERS;a++)
		if(AdminLevel[a]>=2) // YOUR ADMIN VAR here
		{
			SendClientMessage(a,-1,string);
		}
OR

Код:
		SendMessageToAdmins(-1,str);
stock SendMessageToAdmins(color,const string[])
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnectedEx(i))
        if(AdminLevel[i] >=2)
        SendClientMessage(i,color,string);
    }
    return 1;
}
Alright i think foreach is faster than for(new i = 0; i< MAX_PLAYERS , i++) well maybe i'm wrong.
Reply


Messages In This Thread
Issue with loop causing lag. - by MBilal - 18.12.2017, 17:35
Re: Issue with loop causing lag. - by buburuzu19 - 18.12.2017, 17:40
Re: Issue with loop causing lag. - by Eoussama - 18.12.2017, 17:43
Re: Issue with loop causing lag. - by MBilal - 18.12.2017, 17:43
Re: Issue with loop causing lag. - by Eoussama - 18.12.2017, 17:47
Re: Issue with loop causing lag. - by MBilal - 18.12.2017, 17:57
Re: Issue with loop causing lag. - by 0x88 - 19.12.2017, 09:18
Re: Issue with loop causing lag. - by DeitY - 19.12.2017, 10:12
Re: Issue with loop causing lag. - by jasperschellekens - 19.12.2017, 10:22
Re: Issue with loop causing lag. - by MBilal - 19.12.2017, 12:14

Forum Jump:


Users browsing this thread: 2 Guest(s)