Admin Chat <Is this already post here?>
#1

I want my admin chat should be like this "#<text>"
i'm not using /a i just using # OnPlayerText

Code

pawn Код:
if(text[0] == '#' && PlayerInfo[playerid][pAdmin] >= 1)
    {
        new string[128];
        new adminname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,adminname,sizeof(string));
        format(string,sizeof(string),"Admin Chat: %s: "white"%s",adminname,text[1]);
        SendToAdmins(COLOR_RED,string);
        #if ADM_CHAT_LOG == true
        SaveIn("AdminChat",string);
        #endif
        return 0;
    }
The Saving Part is Important i copy it from LuxAdmin
This Admin system is mine not from Luxrion
Reply
#2

Try:
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == "#")
    {
        if(PlayerInfo[playerid][pAdmin] >= 1)
        {
            strdel(text, 0, 1);
                new string[128];
                new adminname[MAX_PLAYER_NAME];
                GetPlayerName(playerid,adminname,sizeof(string));
                format(string,sizeof(string),"Admin Chat: %s: "white"%s",adminname,text);
                SendToAdmins(COLOR_RED,string);
                #if ADM_CHAT_LOG == true
                SaveIn("AdminChat",string);
                #endif
        }
        return 0;

    }
    return 1;
}
Reply
#3

I use this, change it if you want to yours
pawn Код:
public OnPlayerText(playerid, text[])
{
    GetPlayerName(playerid, pname, sizeof(pname));
    if(text[0] == '#' && PData[playerid][Level] >= 1)
    {
        format(str2, sizeof(str2), "(%s (%d)): %s", pname, playerid, text[1]);
        MessageAdmins(cyan, str2);
        return 0;
    }
    return 1;
}
Reply
#4

is this will send #<text> if you type this # (no words)
Reply
#5

If you type only #, it will be like this
PHP код:
(GAMER_PS2 (0)): 
Just # and space
Reply
#6

Comeon help me up
Reply
#7

Should solve:

pawn Код:
if(text[0] == '#' && PlayerInfo[playerid][pAdmin] >= 1 && strlen(text[1]))
{
    new string[128];
    new adminname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,adminname,sizeof(string));
    format(string,sizeof(string),"Admin Chat: %s: "white"%s",adminname,text[1]);
    SendToAdmins(COLOR_RED,string);
    #if ADM_CHAT_LOG == true
    SaveIn("AdminChat",string);
    #endif
    return 0;
}
Reply
#8

Thanks bro i dont need that #<texT> anymore this is what i needed!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)