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

[color chat]


Post New Thread Reply   
 
Thread Tools Display Modes
worldspawn
Senior Member
Join Date: Aug 2009
Location: Russia, Yekaterinburg
Old 12-20-2009 , 04:07   Re: [color chat]
Reply With Quote #11

ohh...yeah...good job
worldspawn is offline
Send a message via ICQ to worldspawn Send a message via Skype™ to worldspawn
joker555
BANNED
Join Date: Dec 2009
Old 12-31-2009 , 15:04   Re: [color chat]
Reply With Quote #12

here can i put all 5 colors in 1 sentence
joker555 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-31-2009 , 16:13   Re: [color chat]
Reply With Quote #13

Quote:
Originally Posted by joker555 View Post
here can i put all 5 colors in 1 sentence
For the last time, YOU CAN'T!!!
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 01-01-2010 , 00:17   Re: [color chat]
Reply With Quote #14

Quote:
Originally Posted by joker555 View Post
here can i put all 5 colors in 1 sentence
what a bad idea !
I so sorry, I think i can't help you !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-05-2010 , 15:55   Re: [color chat]
Reply With Quote #15

Here is the version I currently use:
Code:
enum COLOR_PRINT
{
	COLOR_RANDOM = -4,
	COLOR_GREY,
	COLOR_BLUE,
	COLOR_RED,
}
stock client_print_color(id, {COLOR_PRINT,_}:color_id, message[], any:...)
{
	static SayText, TeamInfo;
	if( !SayText )
		SayText = get_user_msgid("SayText");
	if( !TeamInfo )
		TeamInfo = get_user_msgid("TeamInfo");
	new const TeamName[][] = 
	{
		"",
		"TERRORIST",
		"CT",
		"SPECTATOR"
	};

	new ColorChange;
	if( _:color_id < 0 )
	{
		ColorChange = _:color_id;
		for( new i=1; i<=32; i++ )
		{
			if(is_user_connected(i))
			{
				color_id = COLOR_PRINT:i;
				break;
			}
		}
		if( _:color_id <= 0 )
			return;

		if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
		{
			write_byte(_:color_id);
			switch( COLOR_PRINT:ColorChange )
			{
				case COLOR_RED: write_string(TeamName[1]);
				case COLOR_BLUE: write_string(TeamName[2]);
				case COLOR_GREY: write_string(TeamName[3]);
				default: write_string(TeamName[random_num(1,3)]);
			}
			message_end();
			ColorChange = get_user_team(_:color_id);	
		}
	}

	new message2[128];
	message2[0] = '^1'; //The message must start with a color, this is for normal colors
	vformat(message2[1], 127, message, 4);

	if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, SayText, _, id) )
	{
		write_byte(_:color_id);
		write_string(message2);
		message_end();
	}

	if( ColorChange && message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
	{
		write_byte(_:color_id);
		write_string(TeamName[ColorChange]);
		message_end();
	}
}
And without the enum (just makes it a single function for easy adding to other plugins):
Code:
stock client_print_color(id, color_id, message[], any:...)
{
	static SayText, TeamInfo;
	if( !SayText )
		SayText = get_user_msgid("SayText");
	if( !TeamInfo )
		TeamInfo = get_user_msgid("TeamInfo");
	new const TeamName[][] = 
	{
		"",
		"TERRORIST",
		"CT",
		"SPECTATOR"
	};

	new ColorChange;
	if( color_id < 0 )
	{
		ColorChange = color_id;
		for( new i=1; i<=32; i++ )
		{
			if(is_user_connected(i))
			{
				color_id = i;
				break;
			}
		}
		if( color_id <= 0 )
			return;

		if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
		{
			write_byte(color_id);
			switch( ColorChange )
			{
				case -1: write_string(TeamName[1]);
				case -2: write_string(TeamName[2]);
				case -3: write_string(TeamName[3]);
				default: write_string(TeamName[random_num(1,3)]);
			}
			message_end();
			ColorChange = get_user_team(color_id);	
		}
	}

	new message2[128];
	message2[0] = '^1'; //The message must start with a color, this is for normal colors
	vformat(message2[1], 127, message, 4);

	if( message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, SayText, _, id) )
	{
		write_byte(color_id);
		write_string(message2);
		message_end();
	}

	if( ColorChange && message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, TeamInfo, _, id) )
	{
		write_byte(color_id);
		write_string(TeamName[ColorChange]);
		message_end();
	}
}
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 02-05-2010 , 04:02   Re: [color chat]
Reply With Quote #16

I don't think you version is so good ! emp
__________________
QQ:116268742

Last edited by K.K.Lv; 02-05-2010 at 04:08.
K.K.Lv is offline
Send a message via MSN to K.K.Lv
joker555
BANNED
Join Date: Dec 2009
Old 02-28-2010 , 02:22   Re: [color chat]
Reply With Quote #17

how to put this color in chat

like
client_print_color(JOKER GREEN)
joker555 is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 03-05-2010 , 18:41   Re: [color chat]
Reply With Quote #18

Quote:
Originally Posted by K.K.Lv View Post
I don't think you version is so good ! emp
Emp's is more clear, easier to read, and works perfect. I think you just don't like anyone else's but yours.
__________________
Hi.
Kreation is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-08-2010 , 03:53   Re: [color chat]
Reply With Quote #19

Quote:
Originally Posted by Kreation View Post
Emp's is more clear, easier to read, and works perfect. I think you just don't like anyone else's but yours.
no ! man !
I think my code can show more chat type !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
matsi
Thinkosaur
Join Date: Sep 2006
Old 03-08-2010 , 12:30   Re: [color chat]
Reply With Quote #20

Quote:
Originally Posted by K.K.Lv View Post
no ! man !
I think my code can show more chat type !
Very convincing to start with "I think".
matsi 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 06:56.


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