Raised This Month: $32 Target: $400
 8% 

[CS:S/CS:GO] Chat/Scoreboard Tag Menu


Post New Thread Reply   
 
Thread Tools Display Modes
godzcsgo
Senior Member
Join Date: Jul 2017
Old 12-26-2018 , 15:23   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #61

Yo, can someone make this comptatible with chat-processor.smx and cp-scp-wrapper.smx

Thx.
godzcsgo is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 12-27-2018 , 10:45   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #62

Quote:
Originally Posted by Cruze View Post
If "name_color" is left blank/you use {teamcolor}, it is taking color from "tag_color" and applying on name. If "name_color" has any other thing than {teamcolor}/blank, it is working fine.
Help Please!

edit:-

If someone wants version that works with Chat Processor
PHP Code:
#pragma semicolon 1 

#define    PLUGIN_AUTHOR    "[W]atch [D]ogs"
#define PLUGIN_VERSION    "1.6.0 chat-processor"

#define MAXLENGTH_INPUT            128     // Inclues \0 and is the size of the chat input box.
#define MAXLENGTH_NAME            64        // This is backwords math to get compability.  Sourcemod has it set at 32, but there is room for more.
#define MAXLENGTH_MESSAGE        256        // This is based upon the SDK and the length of the entire message, including tags, name, : etc.

#include <sourcemod> 
#include <cstrike> 
#include <clientprefs>

#undef REQUIRE_PLUGIN
#include <chat-processor>
#define REQUIRE_PLUGIN

#include <multicolors>


Handle h_bEnable;
Handle g_hClientCookies;

char sTags[100][256];
char sFlags[100][8];
char sMode[100][32];
char sTagColors[100][32];
char sNameColors[100][32];
char sTextColors[100][32];
char sSteamIds[100][32];

int iTags 0;

public 
Plugin myinfo 
{
    
name "[CSGO/CSS] Chat/Scoreboard Tag Menu"
    
author PLUGIN_AUTHOR
    
description "An advanced chat & scoreboard tag menu for players"
    
version PLUGIN_VERSION
    
url "https://forums.alliedmods.net/showthread.php?t=299351"
};

public 
void OnPluginStart()
{
    
LoadTranslations("TagMenu.phrases");
    
    
h_bEnable CreateConVar("sm_tagmenu_enable""1""Enable / Disable tag menu"_true0.0true1.0);
    
    
RegConsoleCmd("sm_tag"Command_TagMenu);
    
RegConsoleCmd("sm_tags"Command_TagMenu);
    
RegConsoleCmd("sm_tagmenu"Command_TagMenu);
    
    
RegAdminCmd("sm_reloadtags"Command_ReloadTagsADMFLAG_GENERIC);
    
    
HookEvent("player_spawn"Event_PlayerSetTag);
    
HookEvent("player_team"Event_PlayerSetTag);
    
    
g_hClientCookies RegClientCookie("Tag_Menu""A cookie for saving clients's tags"CookieAccess_Private);
    
    
LoadTagsFromFile();
}

public 
void OnAllPluginsLoaded()
{
    if(!
LibraryExists("chat-processor"))
    {
        
LogError("[TagMenu] Chat Processor(https://forums.alliedmods.net/showthread.php?t=286913) plugin not found! Chat function is disabled.");
    }
}

public 
Action Event_PlayerSetTag(Handle event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
SetClientTag(client);
}

public 
void OnClientPostAdminCheck(int client)
{
    if (
AreClientCookiesCached(client))
    {
        
SetClientTag(client);
    }
}

public 
void OnClientSettingsChanged(int client)
{
    if (
AreClientCookiesCached(client))
    {
        
SetClientTag(client);
    }
}

public 
Action Command_TagMenu(int clientint args)
{
    if (
GetConVarBool(h_bEnable))
        
TagMenu(client);
    else
        
CReplyToCommand(client"%t""TagMenu_Disabled");
    
    return 
Plugin_Handled;
}

public 
Action Command_ReloadTags(int clientint args)
{
    
LoadTagsFromFile();
    
CReplyToCommand(client"%t""Tags_Reloaded");
    return 
Plugin_Handled;
}

public 
void TagMenu(int client)
{
    
Handle menu CreateMenu(MenuCallBack);
    
SetMenuTitle(menu"%t""Menu_Title");
    
    
char sDisableItem[128];
    
Format(sDisableItemsizeof(sDisableItem), "%t""Item_Disable");
    
AddMenuItem(menu"0"sDisableItem);
    
    for (
int i 0iTagsi++)
    {
        
char sInfo[300];
        
Format(sInfosizeof(sInfo), "%s_,_%s"sMode[i], sTags[i]);
        
        if (
sFlags[i][0] == '\0')
        {
            if (
sSteamIds[i][0] != '\0')
            {
                
char sSteamID[32];
                
GetClientAuthId(clientAuthId_EnginesSteamIDsizeof(sSteamID));
                if (
StrEqual(sSteamIds[i], sSteamID))
                    
AddMenuItem(menusInfosTags[i]);
                else
                    
AddMenuItem(menusInfosTags[i], ITEMDRAW_DISABLED);
            }
            else
                
AddMenuItem(menusInfosTags[i]);
        }
        else
        {
            if (
CheckCommandAccess(client""ReadFlagString(sFlags[i])))
            {
                
AddMenuItem(menusInfosTags[i]);
            }
            else
                
AddMenuItem(menusInfosTags[i], ITEMDRAW_DISABLED);
        }
    }
    
    
DisplayMenu(menuclientMENU_TIME_FOREVER);
}

public 
int MenuCallBack(Handle menuMenuAction actionint clientint itemNum)
{
    if (
action == MenuAction_Select)
    {
        
char sItem[256], sSteamID[64];
        
GetMenuItem(menuitemNumsItemsizeof(sItem));
        
GetClientAuthId(clientAuthId_EnginesSteamIDsizeof(sSteamID));
        
        if (
itemNum == 0)
        {
            
CS_SetClientClanTag(client"");
            
SetAuthIdCookie(sSteamIDg_hClientCookies"");
            
CPrintToChat(client"%t""Tag_Disabled");
        }
        else
        {
            
char sItems[2][256];
            
ExplodeString(sItem"_,_"sItems2256);
            
            if (
StrEqual(sItems[0], "chat"))
            {
                
SetAuthIdCookie(sSteamIDg_hClientCookiessItem);
                
CPrintToChat(client"%t""ChatTag_Enabled"sItems[1]);
            }
            else
            {
                
CS_SetClientClanTag(clientsItems[1]);
                
SetAuthIdCookie(sSteamIDg_hClientCookiessItem);
                
CPrintToChat(client"%t""Tag_Enabled"sItems[1]);
            }
        }
    }
    else if (
action == MenuAction_End)CloseHandle(menu);
}

public 
Action CP_OnChatMessage(int &clientArrayList recipientschar[] flagstringchar[] sNamechar[] sMessagebool &processcolorsbool &removecolors)
{
    if(
GetConVarBool(h_bEnable) && (MaxClients >= client 0))
    {
        if(
sMessage[0] == '/' || sMessage[0] == '@')
        {
            return 
Plugin_Continue;
        }
        
        
char sCookie[300];
        
GetClientCookie(clientg_hClientCookiessCookiesizeof(sCookie));
        
        if (
sCookie[0] == '\0')
            return 
Plugin_Continue;
        
        
char sCookies[2][256];
        
ExplodeString(sCookie"_,_"sCookies2256);
        
        if (
StrEqual(sCookies[0], "scoreboard"))
            return 
Plugin_Continue;
        
        
char sTagColor[32], sNameColor[32], sTextColor[32];
        
FindTagColors(sCookies[1], sTagColorsNameColorsTextColor);
        
        
Format(sMessageMAXLENGTH_MESSAGE"%s%s"sTextColorsMessage);
        
Format(sNameMAXLENGTH_NAME"%s%s %s%s"sTagColorsCookies[1], sNameColorsName);
        
        
CFormatColor(sMessageMAXLENGTH_MESSAGE);
        
CFormatColor(sNameMAXLENGTH_MESSAGE);
        
        return 
Plugin_Changed;
    }

    return 
Plugin_Continue;
}

public 
void LoadTagsFromFile()
{
    
Handle kv CreateKeyValues("TagMenu");
    if (
FileToKeyValues(kv"addons/sourcemod/configs/tagmenu.cfg") && KvGotoFirstSubKey(kv))
    {
        
iTags 0;
        do
        {
            
KvGetString(kv"tag"sTags[iTags], 256);
            
KvGetString(kv"flag"sFlags[iTags], 8);
            
KvGetString(kv"steamid"sSteamIds[iTags], 32);
            
KvGetString(kv"tag_color"sTagColors[iTags], 32"{default}");
            
KvGetString(kv"name_color"sNameColors[iTags], 32"{teamcolor}");
            
KvGetString(kv"text_color"sTextColors[iTags], 32"{default}");
            
KvGetString(kv"mode"sMode[iTags], 32"both");
            
iTags++;
        } while (
KvGotoNextKey(kv));
    }
    else
    {
        
SetFailState("[TagMenu] Error in parsing file tagmenu.cfg.");
    }
    
CloseHandle(kv);
}

public 
void SetClientTag(int client)
{
    if (
client || client MaxClients || !GetConVarBool(h_bEnable) || !IsClientConnected(client) || IsFakeClient(client))
        return;
    
    
char sCookie[256];
    
GetClientCookie(clientg_hClientCookiessCookiesizeof(sCookie));
    
    if (
sCookie[0] == '\0')
        return;
    
    
char sCookies[2][256];
    
ExplodeString(sCookie"_,_"sCookies2256);
    
    if (!
StrEqual(sCookies[0], "chat"))
    {
        
char sPlayerTag[64];
        
CS_GetClientClanTag(clientsPlayerTagsizeof(sPlayerTag));
        if (!
StrEqual(sPlayerTagsCookies[1]))
        {
            
CS_SetClientClanTag(clientsCookies[1]);
        }
    }
}

public 
void FindTagColors(char[] sTagchar[] sTagColorchar[] sNameColorchar[] sTextColor)
{
    for (
int i 0iTagsi++)
    {
        if (
StrEqual(sTags[i], sTag))
        {
            
strcopy(sTagColor32sTagColors[i]);
            
strcopy(sNameColor32sNameColors[i]);
            
strcopy(sTextColor32sTextColors[i]);
            break;
        }
    }


Thanks dude! Did you test it ?

If it's working well I'm gonna add it to the main thread.

EDIT : And about your problem , I didn't understand correctly could you describe more ?

EDIT 2 : CFormatColor lines not needed anymore. I tested and made it working thanks ! I added the Chat Processor fix version to the main thread and also your name in plugin authors. Best regards
__________________

Last edited by WatchDogs; 12-27-2018 at 13:25.
WatchDogs is offline
Enzunbi
New Member
Join Date: Jan 2019
Old 01-14-2019 , 21:01   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #63

Can u pls add me on steam "https://steamcommunity.com/id/enzunbi/"

Last edited by Enzunbi; 01-14-2019 at 21:01.
Enzunbi is offline
starcs
Member
Join Date: Nov 2018
Old 01-15-2019 , 21:48   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #64

Is there any way to add a player a tag?
Like: !Tag > > > shows the name of the players and after clicking on a player will show that goes to the tags you have in the configuration.
starcs is offline
Cruze
Veteran Member
Join Date: May 2017
Old 01-16-2019 , 07:00   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #65

Quote:
Originally Posted by WatchDogs View Post
Thanks dude! Did you test it ?

If it's working well I'm gonna add it to the main thread.

And about your problem , I didn't understand correctly could you describe more ?
try keeping "name_color" to blank ("name_color" "") and "tag_colro" to any color then test. It will start applying your "tag_color" to name "name_color".
Quote:
CFormatColor lines not needed anymore.
Oh! Didn't know that. Thanks!!
Quote:
I tested and made it working thanks ! I added the Chat Processor fix version to the main thread and also your name in plugin authors. Best regards
No problem! Just needed chat processor version of this plugin and planned to do it myself. Thanks for adding my name anyways!
__________________
Taking paid private requests! Contact me

Last edited by Cruze; 01-16-2019 at 07:02.
Cruze is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 01-17-2019 , 15:05   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #66

Quote:
Originally Posted by starcs View Post
Is there any way to add a player a tag?
Like: !Tag > > > shows the name of the players and after clicking on a player will show that goes to the tags you have in the configuration.
You can add tag for a player with his/her SteamID in configuration file. But if you are talking about creating a in-game management menu for admins, Good idea ;) I'm gonna add it
__________________

Last edited by WatchDogs; 01-17-2019 at 15:06.
WatchDogs is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 01-17-2019 , 15:16   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #67

Quote:
Originally Posted by Cruze View Post
try keeping "name_color" to blank ("name_color" "") and "tag_colro" to any color then test. It will start applying your "tag_color" to name "name_color".

Oh! Didn't know that. Thanks!!
No problem! Just needed chat processor version of this plugin and planned to do it myself. Thanks for adding my name anyways!
YW dude

I checked the source, It shouldn't happen Maybe it's a SCP or CP color bug. And why set it empty ? set it to something like "{default}" or "{teamcolor}" or completely don't set it. If the problem is just this we can add a check for empty colors and replace with default colors.
__________________

Last edited by WatchDogs; 01-17-2019 at 15:16.
WatchDogs is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 01-17-2019 , 15:29   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #68

Quote:
Originally Posted by Enzunbi View Post
Can u pls add me on steam "https://steamcommunity.com/id/enzunbi/"
I don't have access to steam right now. You can send me private message.
__________________

Last edited by WatchDogs; 01-17-2019 at 15:41.
WatchDogs is offline
Cruze
Veteran Member
Join Date: May 2017
Old 01-18-2019 , 01:08   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #69

Quote:
Originally Posted by WatchDogs View Post
I checked the source, It shouldn't happen Maybe it's a SCP or CP color bug. And why set it empty ? set it to something like "{default}" or "{teamcolor}" or completely don't set it. If the problem is just this we can add a check for empty colors and replace with default colors.
setting "teamcolor" in "name_color" causes the same bug I mentioned.
__________________
Taking paid private requests! Contact me
Cruze is offline
DabberDoug
Member
Join Date: Feb 2016
Location: USA
Old 03-23-2019 , 17:55   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #70

How do you fix it so that players do not have there team color twice when they type?
https://imgur.com/a/IX4ZONQ
DabberDoug is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:26.


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