AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Add color to the chat plugin (https://forums.alliedmods.net/showthread.php?t=315391)

amirwolf 04-05-2019 16:00

Add color to the chat plugin
 
.........

VenomMix 04-06-2019 02:02

Re: Add color to the chat plugin
 
HTML Code:

#include <amxmodx>
#include <amxmisc>
#include <ColorChat>

new g_msgChannel

#define MAX_CLR 10

new amx_show_activity;
new g_AdminChatFlag = ADMIN_CHAT;

public plugin_init()
{
    new admin_chat_id

    register_dictionary("adminchat.txt")
    admin_chat_id = register_concmd("say", "cmdSayAdmin")
    amx_show_activity = get_cvar_pointer("amx_show_activity");
   
    if (amx_show_activity == 0)
    {
        amx_show_activity = register_cvar("amx_show_activity", "2");
    }

    new str[1]
    get_concmd(admin_chat_id, str, 0, g_AdminChatFlag, str, 0, -1)
}

public cmdSayAdmin(id, level, cid)
{
    if (!cmd_access(id, level, cid, 2))
        return PLUGIN_HANDLED

    new message[192], name[32], players[32], inum, authid[32], userid
   
    read_args(message, 191)
    remove_quotes(message)
    get_user_authid(id, authid, 31)
    get_user_name(id, name, 31)
    userid = get_user_userid(id)
    get_players(players, inum)
   
    if (is_user_admin(id))
        ColorChat(0, GREEN, "* ADMINS * %s :  %s", name, message);
    else   
        ColorChat(0, GREEN, "* PLAYER * %s :  %s", name, message);
   
    get_players(players, inum)
       
    console_print(id, "%s", message)
   
    for (new i = 0; i < inum; ++i)
    {
        if (access(players[i], g_AdminChatFlag))
            client_print(players[i], print_chat, "%s", message)
    }
   
    return PLUGIN_HANDLED
}

If you have a ghost chat or chat plugin, disable it, otherwise it will not work properly.

amirwolf 04-06-2019 03:51

Re: Add color to the chat plugin
 
Thanks for your reply
But the color is not added to the plugin
And the message is repeated twice: /
http://8upload.ir/uploads/f692155468.png


All times are GMT -4. The time now is 10:56.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.