Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - HexTags_SetClientTag - Automatically changes color same as prefix #44

Open
Fastmancz opened this issue Dec 26, 2019 · 2 comments
Open

Comments

@Fastmancz
Copy link

Fastmancz commented Dec 26, 2019

Hello,

I want to thank in advance for your plugin. Here I have a simple code:
HexTags_SetClientTag(client, ChatTag, "{green}[★FAST.RIP★] ");

If the prefix is not defined in the configuration, the player's name is colored the same as the prefix.

When I have permissions and have it included in the configuration:

"HexTags"
{
    "s"
    {
        "ChatTag"             "{green}[FAST.RIP Staff] "
    }
}

0005

When I have no permissions and everything is controlled by my script:

PrintToChat(client, "Tag byl vymazán.");
HexTags_SetClientTag(client, ChatTag, "{green}[★FAST.RIP★] ");

0006

Thanks for your fix.

@Hexer10
Copy link
Owner

Hexer10 commented Dec 26, 2019

Just add {default} after the tag and it should work properly

@Fastmancz
Copy link
Author

Thank you for answer. Your solution doesn't work.

int size = 2 * MAX_NAME_LENGTH + 1;
char[] nazev_escaped = new char[size + 1];
SQL_EscapeString(hDatabase, sArgs, nazev_escaped, size + 1);
strcopy(sTag[client], size + 1, nazev_escaped);

Format(sTag[client], sizeof(sTag[]), "%s%s%s", "{gold}[", nazev_escaped, "]{default} ");
HexTags_SetClientTag(client, ChatTag, sTag[client]);

0007

PrintToChat(client, "Tag byl vymazán.");
HexTags_ResetClientTag(client);
HexTags_SetClientTag(client, ChatTag, "{green}[★FAST.RIP★]{default} ");

0008

Format(sTag[client], sizeof(sTag[]), "%s%s%s", "{gold}[", nazev_escaped, "] ");
HexTags_SetClientTag(client, ChatTag, sTag[client]);
HexTags_SetClientTag(client, NameColor, "{default}");

0009

PrintToChat(client, "Tag byl vymazán.");
HexTags_SetClientTag(client, ChatTag, "{green}[★FAST.RIP★] ");
HexTags_SetClientTag(client, NameColor, "{default}");

0010

My "temporary fix".
GetClientTeam(client) == CS_TEAM_CT ? HexTags_SetClientTag(client, NameColor, "{grey2}") : GetClientTeam(client) == CS_TEAM_T ? HexTags_SetClientTag(client, NameColor, "{yellow}") : HexTags_SetClientTag(client, NameColor, "{default}");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants