28.09.2012, 14:35
use this:
tested it works perfectly fine, i hope that helps
pawn Код:
public OnPlayerText(playerid, text[])
{
if(IsPlayerAdmin(playerid) && text[0] == '.')
{
new msg[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(msg, sizeof(msg), "[ADMIN CHAT] %s (ID %d): %s", pName, playerid, text[1]);
SendMessageToAdmins(colorhere,string);
return 0;
}
pawn Код:
forward SendMessageToAdmins(color,const string[]);
public SendMessageToAdmins(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) if (IsPlayerAdmin(i)) SendClientMessage(i, color, string);
}
}