SA-MP Forums Archive
Admin Chat <Is this already post here?> - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admin Chat <Is this already post here?> (/showthread.php?tid=293160)



Admin Chat <Is this already post here?> - GAMER_PS2 - 27.10.2011

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


Re: Admin Chat <Is this already post here?> - Biesmen - 27.10.2011

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



Re: Admin Chat <Is this already post here?> - Kostas' - 27.10.2011

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



Re: Admin Chat <Is this already post here?> - GAMER_PS2 - 27.10.2011

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


Re: Admin Chat <Is this already post here?> - Kostas' - 27.10.2011

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


Re: Admin Chat <Is this already post here?> - GAMER_PS2 - 27.10.2011

Comeon help me up


Re: Admin Chat <Is this already post here?> - CyNiC - 27.10.2011

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



Re: Admin Chat <Is this already post here?> - GAMER_PS2 - 28.10.2011

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