AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help with admin colored names (https://forums.alliedmods.net/showthread.php?t=240578)

aron9forever 05-18-2014 07:16

help with admin colored names
 
So here's the deal, I've rewritten the cstrike chat entirely to be handled by amxx, not only the dead people, because people were heavily abusing the color thanslit bug and I can't find the plugin that causes it to actually work, probably the colorchat stock I use.

So this is how an admin message looks now:
[ADMIN] Name : Message
I've struggled to even set their name to be colored and I couldn't , the only thing I managed to do is color the message entirely.
This is how the message is handled
Code:
// Gather information     new is_alive = is_user_alive(id);     new message[129];     read_argv(1,message,128);     new name[33];     get_user_name(id,name,32);     new player_count = get_playersnum();     new players[32];     get_players(players, player_count, "c");     // Clients sometimes send empty messages, or a message containig a '[', ignore those.     if (equal(message,"")) return PLUGIN_CONTINUE;     if (equal(message,"[")) return PLUGIN_CONTINUE;     if (equal(message,"!")) return PLUGIN_CONTINUE;     if (equal(message,"glow")) return PLUGIN_CONTINUE;       // Response to a specific query     if (containi(message,"%") != -1) return PLUGIN_HANDLED;     if (containi(message,"/") != -1) return PLUGIN_CONTINUE;         // Format the messages, the %c (2) adds the color. The client decides what color     // it gets by looking at team.     new CsTeams:team = cs_get_user_team(id)     switch(team)     {         case CS_TEAM_T:         {             if(get_user_flags(id) & ADMIN_KICK)             {                 format(message, 127, "%c[ADMIN] %s :   %s^n", 2, name, message);             }

I've tried adding the colors to this format, it did not work
I tried splitting the message up in multiple formats and adding the colors one by one, still won't work
the biggest problem I had is that the ^4 would get replaced by empty characters and show up as blank space in the client message instead of making it colored

If anyone could make the [ADMIN] tag terrorist red(or at least team specific color) and the name green I would be very glad


All times are GMT -4. The time now is 09:48.

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