14.09.2012, 19:17
First add stock for admin chat..
EDITED: to fit with your admin level defining
pawn Код:
stock SendMessageToAdmins(color, const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt > Level)
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}
CMD:a(playerid,params[])
{
#pragma unused params
//new pname[MAX_PLAYER_NAME]; //Your playername stock..
new string[128];
if(GetPVarInt > Level)
{
if(!strlen(params)) return SendClientMessage(playerid,COLOR_ERROR,"Usage: /ac (Message)");
//GetPlayerName(playerid, pname, sizeof(pname)); //Your player name stock..
format(string,sizeof(string), "[ADMIN MESSAGE] %s(%d): %s",pname, playerid, params);
SendMessageToAdmins(COLOR_RED, string);
return 1;
}
}