20.02.2015, 06:05
pawn Код:
public OnPlayerText(playerid,text[])
{
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
if(PInfo[playerid][pAdminDuty] == 1)
{
format(string, sizeof(string), "Administrator %s: %s", name, text);
return SendClientMessageToAll(COLOR_GOLD, string);
}
if(PInfo[playerid][Level] > 1 && text[0] == '.')
{
format(string, sizeof(string),"[ADMIN CHAT] %s[%d]: %s", name, playerid, text[1]);
return MessageToAdmins(COLOR_MEDIUMSEAGREEN, string);
}
return 1;
}
EDIT: i have edited the code, basically removed string Prefix because there is no need for it. You directly plot it it ing the main string manualy. And some simplifications!