Issue with loop causing lag.
#2

Quote:
Originally Posted by MBilal
Посмотреть сообщение
Well I'm using this code to send message to admins only it working perfect but but.
the problem come it causing lag because I'm calling this function in many locations like when some body
cheating it send message to admin even some body join it send message to admin.
Now it start making lag.

Код:
SendToAdmins(color,Message[])
{
	foreach(new i : Player)
	{
	if(pInfo[i][pLevel] >= 1)
	SCM(i, color, Message);
	}
	return 1;
}
Is there anyway rather than using loop i can send message to only admins?

Cheers.
Thanks
if(pInfo[i][pLevel] >= 1) you don't need this line. You need something like pAdmin or pAdminLevel >= 1.
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: 4 Guest(s)