Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Cruze
Veteran Member
Join Date: May 2017
Old 09-12-2017 , 01:05   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #51

Quote:
Originally Posted by A_RM View Post
Would you consider providing compatibility with ckSurf ranks? Right now the following happens if you have ranks & a chat tag enabled, chat shows your message twice like so:

I would be content with it just showing the first and it overriding your ckSurf rank if you have a tag enabled.

Also the ability to force tags enabled by default (it chooses the highest one in the list you're eligible for in the tagmenu.cfg).
You can't use it with cksurf.(as far as i know)
I recommend using "Custom Chat Title" which is already inbuilt in cksurf
__________________
Taking paid private requests! Contact me
Cruze is offline
A_RM
AlliedModders Donor
Join Date: Oct 2016
Location: Canada
Old 09-12-2017 , 11:50   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #52

I know you can't in its current release, are you saying it wouldn't be possible to do period? I'm not very familiar with how chat processing works.

The built in ckSurf custom title's aren't optimal for what I want. I'm looking for something that will assign chat tags based on flags but still retain rank for other users. Isn't feasible to have to set them manually. Maybe I'll have to request a modified version of ckSurf elsewhere instead.
A_RM is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 09-14-2017 , 18:48   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #53

Updated To 1.6.0 SCP


- Now all chat bugs are fixed with handling the chat by Simple Chat Processor.

- Please Replace all of the files (except tagmenu.cfg) and restart the server if you are upgrading the plugin.

- Removed anti-spam cvars and cfg file because not needed anymore.
__________________

Last edited by WatchDogs; 09-14-2017 at 19:01.
WatchDogs is offline
A_RM
AlliedModders Donor
Join Date: Oct 2016
Location: Canada
Old 10-13-2017 , 13:56   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #54

Scoreboard still doesn't work for me. Tried "both" & "scoreboard" and it won't show on the scoreboard. Chat tag always shows, even if I just put "scoreboard".

*edit: Nvm I got it to work fully on some servers, but others it doesn't. Probably just something conflicting on my end!

Last edited by A_RM; 10-25-2017 at 19:02.
A_RM is offline
Wacci
AlliedModders Donor
Join Date: May 2017
Location: Hungary
Old 03-06-2018 , 18:06   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #55

I've got 2 small problem:
- Can you make flag check for the saved tag ? If you him lost your flag, lose your tag too. (when he join, or mapchange)
- Teamcolor dosen't work (using tag's color at now)

Will/Can you make swear filter with Sourcebans support ?
__________________
Wacci is offline
Jezis
AlliedModders Donor
Join Date: Jul 2016
Location: Czech Republic
Old 03-12-2018 , 15:17   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #56

<3 this plugin. It helped me a lot.

But could you set something like default tag, so everyone will have it even without chosing any?
__________________

Jezis is offline
Send a message via ICQ to Jezis
pimP_
Junior Member
Join Date: Feb 2018
Old 03-19-2018 , 03:29   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #57

hi there, colors arent working for me at all
the tags do, colors, no.

https://gyazo.com/f3b489377be12b04b63fff1ed0bd1087

Last edited by pimP_; 03-19-2018 at 03:30.
pimP_ is offline
deville
AlliedModders Donor
Join Date: Oct 2016
Old 09-30-2018 , 07:17   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #58

Teamcolor is not working
deville is offline
Cruze
Veteran Member
Join Date: May 2017
Old 10-01-2018 , 06:51   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #59

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

Attached Files
File Type: zip Tag Menu 1.6.0 - Chat Processor.zip (40.5 KB, 137 views)
__________________
Taking paid private requests! Contact me

Last edited by Cruze; 10-01-2018 at 07:46. Reason: added chat-processor supported version!
Cruze is offline
sime0282
Member
Join Date: Dec 2017
Old 12-16-2018 , 16:39   Re: [CS:S/CS:GO] Chat/Scoreboard Tag Menu
Reply With Quote #60

Quote:
If I change these. The color and plugin won't work ingame


"tag" "[Pro-Player]"

to

"tag" "[Admin]"


[TagMenu] Your new tag [Admin] has been enabled.

https://gyazo.com/218453597979904b29661fad79b67e0a


"TagMenu" // Main key. Don't change it.
{
"1" // Indexes. They must be in order from 1 and on. Maximum is 100.
{
"tag" "[Admin]" // "tag" is identifier. Don't change it. Change the next string like "[Pro-Player]".
"flag" "b" // "flag" is identifier. Don't change it. Set a flag for tag access (empty = everyone)
"steamid" "STEAM_XX" // "steamid" is identifier. Only if "flag" was empty plugin uses this. Make tag special for a steamid only.
"tag_color" "{green}" // "tag_color" is identifier. Set client chat tag color. (Default is "{default}")
"name_color" "{teamcolor}" // "name_color" is identifier. Set client chat name color. (Default is "{teamcolor}")
"text_color" "{default}" // "text_color" is identifier. Set client chat text color. (Default is "{default}")
"mode" "both" // "mode" is identifier. Set tag mode (valid values are: "both" - "scoreboard" - "chat", Default is "both")
}
"2"
{
"tag" "[Noob]"
"flag" ""
"tag_color" "{green}"
"name_color" "{teamcolor}"
"text_color" "{purple}"
"mode" "chat"
}
"3"
{
"tag" "[Expert]"
"flag" "a"
"mode" "scoreboard"
}
"4"
{
"tag" "[Owner]"
"steamid" "STEAM_0:1:123456789"
"mode" "both"
}
}

Last edited by sime0282; 12-16-2018 at 16:39.
sime0282 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 17:59.


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