08.10.2011, 10:28
pawn Code:
public OnPlayerText(playerid, text[])
{
if(ChatClosed == 1 && !IsPlayerAdmin(playerid) && PlayerInfo[playerid][AdminLevel] < 3)
{
SendClientMessage(playerid, COLOR_RED, "Chat Is Closed");
return 0;
}
new string[256];
if(IsPlayerAdmin(playerid))
{
format(string, sizeof(string), "[Server Programmer]%s: %s [ID:%d]", GetName(playerid), text, playerid);
SendClientMessageToAll(COLOR_LIGHTGREEN, string);
}
else if(PlayerInfo[playerid][AdminLevel] == 0)
{
format(string, sizeof(string), "%s: {FFFFFF}%s [ID:%d]", GetName(playerid), text, playerid);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
else if(PlayerInfo[playerid][AdminLevel] == 1)
{
format(string, sizeof(string), "[Activity Maneger]%s: %s [ID:%d]", GetName(playerid), text, playerid);
SendClientMessageToAll(COLOR_AM, string);
}
else if(PlayerInfo[playerid][AdminLevel] >= 2 && PlayerInfo[playerid][AdminLevel] <= 4)
{
format(string, sizeof(string), "[Admin]%s: %s [ID:%d]", GetName(playerid), text, playerid);
SendClientMessageToAll(COLOR_ADMIN, string);
}
else if(PlayerInfo[playerid][AdminLevel] == 5)
{
format(string, sizeof(string), "[Main Admin]%s: %s [ID:%d]", GetName(playerid), text, playerid);
SendClientMessageToAll(COLOR_ADMIN, string);
}
return 0;
}