Raised This Month: $ Target: $400
 0% 

Hud Message Not Showing Properly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Paulster1022
Member
Join Date: Apr 2006
Old 07-10-2007 , 23:41   Hud Message Not Showing Properly
Reply With Quote #1

Hey Guys, im having a problem that i can not figure out. I have 2 hud messages showing. One is a stealth meter and One is a camp meter. The stealth meter seems to work fine. The camp meter dissapears after seconds...and randomly comes back. I thought it would have been the hud channels but no its not. The stealth meter is some how interferring with the camp meter. I have tryed everything and im asking for some help. Maby the stealth meter is overwriting the camp meter or something. I am not sure but i know the stealth meter is interferring with the camp meter some how.

Stealth meter = HUD that is working properly
Code:
register_forward(FM_PlayerPreThink, "Forward_PlayerPreThink")


public Forward_PlayerPreThink(id)
{
    if(!is_user_alive(id))
        return FMRES_IGNORED
        
    set_hudmessage(0, 255, 0, -1.0, 0.79, 0, 6.0, 2.0, 0.0, 0.0, 1)
    if( pev( id, pev_button ) & IN_USE && !( pev( id, pev_oldbuttons ) & IN_USE ) )
        biteFunction(id)
    
 
    new target, body
    if(cs_get_user_team(id) == CS_TEAM_CT)
    {
        if(g_flashlight[id])
        {
            get_user_aiming(id, target,body)
            if(get_entity_distance(id, target) < 500 && cs_get_user_team(target) == CS_TEAM_T)
                fakedamage ( target, "Flash Light Burn", 1.0, 1024 )
        }
    }
    
    if(cs_get_user_team(id) != CS_TEAM_T)
        return FMRES_IGNORED    
    
    new Float:Velocity[3]
    pev(id,pev_velocity,Velocity)
    new Float:Speed = Velocity[0] + Velocity[1] + Velocity[2],Modifier = Speed != 0.0 ? 1 : -1,Float:RenderAmount = float((g_LastRender[id] = clamp(g_LastRender[id] + Modifier,0,255)))
 
    set_pev(id,pev_renderfx,kRenderFxGlowShell)
    set_pev(id,pev_rendercolor,Float:{0.0,0.0,0.0})
    set_pev(id,pev_rendermode,kRenderTransAlpha)
    set_pev(id,pev_renderamt,RenderAmount)
    if(RenderAmount <= 0)
        ShowSyncHudMsg(id, g_MyMsgSync, "Stealth: Fully Invisible" )
    else
        ShowSyncHudMsg(id, g_MyMsgSync, "Stealth: %i / 255", floatround(RenderAmount) ) 
    
    return FMRES_IGNORED
 
}
Camp Meter = Hud Dissapears after seconds.
Code:
public meter_display(id)
{
	new displayMeter = get_pcvar_num(g_cvarDisplay);
	
	if (displayMeter > 0 && g_meter[id] >= displayMeter)
	{
		new r, g, b;
		
		if (g_meter[id] > 90)
			r = 255;
		else if (g_meter[id] > 80)
		{
			r = 255; 
			g = 100;
		}
		else if (g_meter[id] > 50) 
		{
			r = 255;
			g = 255;
		}
		else if (g_meter[id] > 20) 
			g = 255; 
		else 
			b = 255;
		set_hudmessage(r, g, b, 0.02, 0.90, 0, 1.0, 2.0, 0.1, 0.1, 4);
		ShowSyncHudMsg(id, g_campMeterMsgSync, "%L", id, "CAMP_METER", g_meter[id]);
		
		// if allowed and there's anyone specing this player, go ahead and show them the meter too
		if (g_cvarShowSpec)
		{
			new playerCnt, players[MAX_PLAYER_CNT], id_spectator;
			get_players(players, playerCnt, "bch");	// skip alive players, bots, and hltv
			for (new playerIdx = 0; playerIdx < playerCnt; ++playerIdx)
			{
				id_spectator = players[playerIdx];
				
				if (pev(id_spectator, pev_iuser2) == id)
				{
					ShowSyncHudMsg(id_spectator, g_campMeterMsgSync, "%L", id, "CAMP_METER", g_meter[id]);
				}				
			}
		}
	}
}
If anyone could help me out that would be great. Thank you.
Paulster1022 is offline
Send a message via AIM to Paulster1022
_Master_
Senior Member
Join Date: Dec 2006
Old 07-12-2007 , 12:07   Re: Hud Message Not Showing Properly
Reply With Quote #2

Please read documentation on Syncronized hud messages. There is info on hud channels as well.
_Master_ 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 21:33.


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