08.10.2011, 08:53
do i have to put else in this code? (because if i put it this way it send "Chat Is Closed" but send a message like the default message... and not what i did)
pawn Code:
public OnPlayerText(playerid, text[])
{
if(ChatClosed == 1 && !IsPlayerAdmin(playerid) && PlayerInfo[playerid][AdminLevel] < 3) return SendClientMessage(playerid, COLOR_RED, "Chat Is Closed");
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;
}