What this script will do ?
#1

Is this gonna send a msg to all the admins or just one ?
(cause in my server it send only to one admin ... and normaly all the admins should get the msg)
Код:
		for (new i = 0; i < MAX_PLAYERS; i++)
		{
			if (IsPlayerConnected(i)&&GetAdminLevel(i) >= 1)
			{
				SendClientMessage(i, COLOR_GRAY, str);
				return 1;
			}
		}
Reply
#2

Don't use a return there. That will break out of the loop and stop processing the code.
Reply
#3

it's in the end of the cmd so no effect i think
Reply
#4

As AndreT said, remove the "return 1" from the loop.
The way it's now, it will only send the message to the first admin in the list of connected players and will then stop, preventing all admins to be informed.

pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++)
{
    if (IsPlayerConnected(i) && GetAdminLevel(i) >= 1)
    {
        SendClientMessage(i, COLOR_GRAY, str);
    }
}

return 1;
Reply
#5

That'll send a message to the people if their connected and their admin level is higher then 1.

After you fix the loop
Reply
#6

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++)
{
    if (IsPlayerConnected(i) && GetAdminLevel(i) >= 1)
    {
        SendClientMessage(i, COLOR_GRAY, str);
    }
}

return 1;
This way is to all admins right ? (just because of the return XD) thnks dude ++ rep for those how helped me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)