29.05.2014, 12:28
pawn Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '#' && PlayerInfo[playerid][pAdmin])
{
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "(ADMIN CHAT) %s: {FFFFFF}%s", name, text[1]);
//If you have a SendAdminMessage or something, use it here instead of the loop
for(new i = 0; i < MAX_PLAYERS; i++) //foreach is better :)
{
if(!IsPlayerConnected(i)) continue;
if(!PlayerInfo[playerid][pAdmin]) continue;
SendClientMessage(i, -1, str); //'-1' is the color, change that to whatever you want your admin chat to be
}
return 0;
}
return 1;
}