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

Script help Hudmessage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mattiiias93
Member
Join Date: Mar 2012
Old 04-16-2012 , 15:39   Script help Hudmessage
Reply With Quote #1

Can someone change the color to green in hudmessage? Spectate info plugin. Same postion but green thanks!



Code:
#include <amxmodx>
#include <fakemeta>

#pragma semicolon 1

#define RED 64
#define GREEN 64
#define BLUE 64
#define UPDATEINTERVAL 1.0

// Comment below if you do not want /speclist showing up on chat
#define ECHOCMD

// Admin flag used for immunity
#define FLAG ADMIN_IMMUNITY

new const PLUGIN[] = "SpecList";
new const VERSION[] = "1.2a";
new const AUTHOR[] = "Random";

new gMaxPlayers;
new gCvarOn;
new gCvarImmunity;
new bool:gOnOff[33] = { true, ... };

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_cvar(PLUGIN, VERSION, FCVAR_SERVER, 0.0);
	gCvarOn = register_cvar("amx_speclist", "1", 0, 0.0);
	gCvarImmunity = register_cvar("amx_speclist_immunity", "0", 0, 0.0);
	
	register_clcmd("say /gagaggagadspeclist", "cmdSpecList", -1, "");
	
	gMaxPlayers = get_maxplayers();
	
	set_task(UPDATEINTERVAL, "tskShowSpec", 123094, "", 0, "b", 0);
}

public cmdSpecList(id)
{
	if( gOnOff[id] )
	{
		client_print(id, print_chat, "");
		gOnOff[id] = false;
	}
	else
	{
		client_print(id, print_chat, "");
		gOnOff[id] = true;
	}
	
	#if defined ECHOCMD
	return PLUGIN_CONTINUE;
	#else
	return PLUGIN_HANDLED;
	#endif
}

public tskShowSpec()
{
	if( !get_pcvar_num(gCvarOn) )
	{
		return PLUGIN_CONTINUE;
	}
	
	static szHud[1102];//32*33+45
	static szName[34];
	static bool:send;
	
	// FRUITLOOOOOOOOOOOOPS!
	for( new alive = 1; alive <= gMaxPlayers; alive++ )
	{
		new bool:sendTo[33];
		send = false;
		
		if( !is_user_alive(alive) )
		{
			continue;
		}
		
		sendTo[alive] = true;
		
		get_user_name(alive, szName, 32);
		format(szHud, 45, "Spectating %s:^n", szName);
		
		for( new dead = 1; dead <= gMaxPlayers; dead++ )
		{
			if( is_user_connected(dead) )
			{
				if( is_user_alive(dead)
				|| is_user_bot(dead) )
				{
					continue;
				}
				
				if( pev(dead, pev_iuser2) == alive )
				{
					if( !(get_pcvar_num(gCvarImmunity)&&get_user_flags(dead, 0)&FLAG) )
					{
						get_user_name(dead, szName, 32);
						add(szName, 33, "^n", 0);
						add(szHud, 1101, szName, 0);
						send = true;
					}

					sendTo[dead] = true;
					
				}
			}
		}
		
		if( send == true )
		{
			for( new i = 1; i <= gMaxPlayers; i++ )
			{
				if( sendTo[i] == true
				&& gOnOff[i] == true )
				{
					set_hudmessage(RED, GREEN, BLUE,
						0.75, 0.15, 0, 0.0, UPDATEINTERVAL + 0.1, 0.0, 0.0, -1);
					
					show_hudmessage(i, szHud);
				}
			}
		}
	}
	
	return PLUGIN_CONTINUE;
}

public client_connect(id)
{
	gOnOff[id] = true;
}

public client_disconnect(id)
{
	gOnOff[id] = true;
}

Last edited by Exolent[jNr]; 04-16-2012 at 16:58. Reason: Added [code] tags.
mattiiias93 is offline
DelFast
Member
Join Date: May 2011
Old 04-16-2012 , 15:46   Re: Script help Hudmessage
Reply With Quote #2

This code in a tag ([*code][*/code])
Change RED, GREE, BLUE in:
Code:
set_hudmessage(RED, GREEN, BLUE,
 0.75, 0.15, 0, 0.0, UPDATEINTERVAL + 0.1, 0.0, 0.0, -1);
DelFast is offline
kapzz
Member
Join Date: Mar 2012
Location: Mars
Old 04-16-2012 , 16:56   Re: Script help Hudmessage
Reply With Quote #3

And u need a RGB color code.
go here u have some codes of greens.
http://www.tayloredmktg.com/rgb/#GRE

Last edited by kapzz; 04-16-2012 at 16:58.
kapzz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-16-2012 , 21:16   Re: Script help Hudmessage
Reply With Quote #4

Quote:
Originally Posted by DelFast View Post
This code in a tag ([*code][*/code])
Change RED, GREE, BLUE in:
Code:
set_hudmessage(RED, GREEN, BLUE,
 0.75, 0.15, 0, 0.0, UPDATEINTERVAL + 0.1, 0.0, 0.0, -1);
You should not change them there. You should assign them at the top of the plugin where they are already declared.

PHP Code:
#define RED 0
#define GREEN 255
#define BLUE 0 
__________________
fysiks 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 09:51.


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