Onplayertext
#4

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;
}
Reply


Messages In This Thread
Onplayertext - by omer5198 - 08.10.2011, 08:53
Re: Onplayertext - by [HiC]TheKiller - 08.10.2011, 09:46
Re: Onplayertext - by omer5198 - 08.10.2011, 10:06
Re: Onplayertext - by Jafet_Macario - 08.10.2011, 10:28

Forum Jump:


Users browsing this thread: 2 Guest(s)