Raised This Month: $ Target: $400
 0% 

Help generating hud messages


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
vbSteve
Junior Member
Join Date: Jun 2006
Old 02-22-2007 , 06:50   Help generating hud messages
Reply With Quote #1

Hi,


I generated a hud message, well a few, to be all shown the same time on screen. My problem is, it's only showing 2 of 5 messages.

Here's my code:

Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>     
#include <fakemeta>
#include <ns>
#include <fun>
#include <cstrike>

#define AppVersion		"1.2"
#define AppName			"CTF Classic Mod"
#define AppAuthor		"mCoDev Systems"

#define chatPref		"[CTF Classic]"
#define T_TEAM			1
#define CT_TEAM			2


new TFlag, TBase, CFlag, CBase;
new THolder, CHolder;

new TScore, CScore, TLoc[51]="Base", CLoc[51]="Base";
new gmsgTeamScore;
new Float:orgTBase[3], Float:orgCBase[3];


(...)


public generateHud(){
        // This proc is updated every 1 sec.
	new j;

        // Update the scoreboard:
	message_begin(MSG_ALL, sTeamScore);
	write_string("TERRORIST");
	write_short(TScore);
	message_end();
	
	message_begin(MSG_ALL, sTeamScore);
	write_string("CT");
	write_short(CScore);
	message_end();
	
	
        // For all clients, show hud messages:
	for(j=1; j < get_maxplayers(); j++){
		if(is_user_connected(j)){
			set_hudmessage(255, 255, 255, -1.0, 0.0, 0, 6.0, 1.0, 0.1,0.1,82);
			show_hudmessage(j, "CTF Classic Mod");
		
			set_hudmessage(255, 0, 0, 0.35, 0.06, 0, 6.0, 1.0, 0.1,0.1,23);
			show_hudmessage(j, "T [%i]", TScore);
			
			set_hudmessage(255, 255, 255, -1.0, 0.06, 0, 6.0, 1.0, 0.1,0.1,24);
			show_hudmessage(j, "-");
			
			set_hudmessage(0, 0, 255, 0.55, 0.06, 0, 6.0, 1.0, 0.1,0.1,35);
			show_hudmessage(j, "CT [%i]", CScore);
			
			if(get_user_team(j)==T_TEAM){
				set_hudmessage(255, 0, 0, 0.01, 0.9, 0, 6.0, 1.0, 0.1,0.1,26);
				show_hudmessage(j, "T Flag: %s", TLoc);
			} else{
				if(get_user_team(j)==CT_TEAM){
					set_hudmessage(0,0,255, 0.01, 0.9, 0, 6.0, 1.0, 0.1,0.1,26);
					show_hudmessage(j, "CT Flag: %s", CLoc);
				} else{
					set_hudmessage(255,255,255, 0.01, 0.9, 0, 6.0, 1.0, 0.1,0.1,26);
					show_hudmessage(j, "T Flag: %s   --  CT Flag: %s", TLoc, CLoc);
				}
			}		
		}
	}
	

        // Set next timeframe:
	set_task(1.0, "generateHud");
}
I already tried putting each message on a different channel; but then I got the opposit: the ones that weren't visible,are visible and the other not.

Any ideas?


Thanks,
Steve
vbSteve is offline
 



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 00:44.


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