SendClientMessageToAll
#1

How can I SendClientMessageToAll for the admins only?
Reply
#2

If you have foreach:

pawn Код:
stock MessageToAdministrators( required_level, color, const string[] )
{
    foreach(Player, i)
    {
      if( GetPVarInt( i, "AdminLevel" ) >= required_level )
      {
        SendClientMessage( i, color, string );
      }
    }
    return 1;
}
I imagine you'll need to update the admin check.
Reply
#3

Here, ofcourse change the PlayerInfo[i][pAdmin] to your admin variable.
Код:
SendAdminMessage(level, color, string[])
{
  for(new i; i < MAX_PLAYERS; i++)
  {
    if(PlayerInfo[i][pAdmin] >= level)
      SendClientMessage(i, color, string);
  }
}
And use it like this:
Код:
SendAdminMessage(3, COLOR_RED, "Message to all admins which are level 3 or higher.");
And if you only want it to RCON admins:
Код:
SendAdminMessage(color, string[])
{
  for(new i; i < MAX_PLAYERS; i++)
  {
    if(IsPlayerAdmin(i))
      SendClientMessage(i, color, string);
  }
}
Код:
SendAdminMessage(COLOR_RED, "Message to all RCON admins.");
Reply
#4

Awesome! Thanks guys ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)