25.08.2012, 13:37
Well, as far as I know you are trying to make separate chats for each admin level so that's how you can do; the script you made has no sense at all (no offence) So, this is how I made:
SendAdminMessage sends the message to the SAME level as you put in level parameter, let me explain you;
This will send message to ONLY level 3 admins. Hope this clears it
Edit: It is the complete code lol. If you want to send the admin message to all admins, you can simply use a loop:
pawn Код:
dcmd_ac(playerid,params[])
{
if( AdminLevel[ playerid ] < 1 ) return 0;
if(!strlen(params)) return SendClientMessage(playerid,COLOR_ERROR,"Usage: /ac (Message)");
new pname[MAX_PLAYER_NAME];
new string[128];
format(string,sizeof(string), "[ADMIN CHAT] %s(%d): %s",pname(playerid), playerid, params); // error line
SendAdminMessage( AdminLevel[ playerid ], COLOR_PINK, string ); // AdminLevel[ playerid ] his level and color and then string
return 1;
}
pawn Код:
SendAdminMessage( 3, COLOR_PINK, string ); // level 3
Edit: It is the complete code lol. If you want to send the admin message to all admins, you can simply use a loop:
pawn Код:
for( new f = 1; f < 10; f++ ) // change 10 to the MAX level of admin system you want
{
SendAdminMessage( f, color, string ); // this will send the admin message to all admin levels from 1 to 10
}