Author Topic: System Admins Chat  (Read 4061 times)

0 Members and 1 Guest are viewing this topic.

Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
System Admins Chat
« on: May 03, 2013, 01:27:42 am »
[pawn]#define RED               0xF0182DFF
#define COLOR_YELLOW      0xFFFF00AA

//OnPlayerCommandText

else if ( strcmp( cmd, "adminchat", true ) == 0)
   {
          new szMsg[ 128 ];
      {
      if(GetPlayerLevel(playerid) == 0)
         {
                for(new i=0;i<MAX_PLAYERS;i++)
                {
            if(IsPlayerConnected(i) && GetPlayerLevel(i) >= 1)
                {
                        format( szMsg, sizeof( szMsg ), "Admin > %s : %s", gPlayers[ playerid ],cmdtext[2]);
                  SendClientMessage(i,COLOR_YELLOW,szMsg);

                  }
            }

         }
         else SendClientMessage(playerid,RED,"You is not an administrator");
        }
      return 1;
      }

//This Chat with levels and For Administrators
=================================
//Chat To The Administrators In Rcon

else if ( strcmp( cmd, "adminchat", true ) == 0)
   {
          new szMsg[ 128 ];
      {
      if(GetPlayerLevel(playerid) == 0)
         {
                for(new i=0;i<MAX_PLAYERS;i++)
                {
            if(IsPlayerConnected(i) && IsPlayerAdmin(i))
                {
                        format( szMsg, sizeof( szMsg ), "Admin > %s : %s", gPlayers[ playerid ],cmdtext[2]);
                  SendClientMessage(i,COLOR_YELLOW,szMsg);

                  }
            }

         }
         else SendClientMessage(playerid,RED,"You is not an administrator Rcon");
        }
      return 1;
      }[/pawn]

If you find any bug speaks to me  ;)

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: System Admins Chat
« Reply #1 on: May 03, 2013, 10:34:48 am »
I suggest you to use for your system just OnPlayerCommandText, 'cause when you use OnPlayerText all online players will see what you written. (so that will not be just an admin chat)

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Re: System Admins Chat
« Reply #2 on: May 03, 2013, 03:41:02 pm »
getplayerlevel... the public is not defined...
is of warchief...

I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline tyler12

  • Street Thug
  • *
  • Posts: 3
    • View Profile
Re: System Admins Chat
« Reply #3 on: May 04, 2013, 02:25:04 am »
You can use something like this, #This is admin chat.

Code: [Select]
public OnPlayerText(playerid,text[])
{
new string[124],Name[24];
if(text[0] == '#' && IsPlayerAdmin(playerid))
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            GetPlayerName(playerid,Name,sizeof(Name));
            format(string,sizeof(string),"Admin Chat %s: %s",Name,text[1]);
SendClientMessage(i,-1,string);
}
}
}
return 1;
}