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

Opposite of m_iHideHUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
foon
Member
Join Date: Dec 2018
Old 12-18-2019 , 01:54   Opposite of m_iHideHUD
Reply With Quote #1

Is there a way to do the opposite of m_iHideHUD? I would like to force part of the hud on a player.
foon is offline
Balimbanana
Member
Join Date: Jan 2017
Old 12-24-2019 , 12:52   Re: Opposite of m_iHideHUD
Reply With Quote #2

From shareddefs.h
Code:
//===================================================================================================================
// Hud Element hiding flags
#define	HIDEHUD_WEAPONSELECTION			( 1<<0 )	// Hide ammo count & weapon selection
#define	HIDEHUD_FLASHLIGHT			( 1<<1 )
#define	HIDEHUD_ALL				( 1<<2 )
#define HIDEHUD_HEALTH				( 1<<3 )	// Hide health & armor / suit battery
#define HIDEHUD_PLAYERDEAD			( 1<<4 )	// Hide when local player's dead
#define HIDEHUD_NEEDSUIT			( 1<<5 )	// Hide when the local player doesn't have the HEV suit
#define HIDEHUD_MISCSTATUS			( 1<<6 )	// Hide miscellaneous status elements (trains, pickup history, death notices, etc)
#define HIDEHUD_CHAT				( 1<<7 )	// Hide all communication elements (saytext, voice icon, etc)
#define	HIDEHUD_CROSSHAIR			( 1<<8 )	// Hide crosshairs
#define	HIDEHUD_VEHICLE_CROSSHAIR		( 1<<9 )	// Hide vehicle crosshair
#define HIDEHUD_INVEHICLE			( 1<<10 )
#define HIDEHUD_BONUS_PROGRESS			( 1<<11 )	// Hide bonus progress display (for bonus map challenges)
#define HIDEHUD_RADAR				( 1<<12 )	// Hide the radar

#define HIDEHUD_BITCOUNT			13
Can remove flags with for example:
m_iHideHud &= ~HIDEHUD_CHAT
and add flags with
m_iHideHud |= HIDEHUD_CHAT

So what you would want to be doing is always removing the flag if it is set:
Code:
int hidehud = GetEntProp(client, Prop_Data, "m_iHideHUD");
if (hidehud & HIDEHUD_CHAT)
{
	hidehud &= ~HIDEHUD_CHAT;
	SetEntProp(client, Prop_Data, "m_iHideHUD", hidehud);
}
Balimbanana is offline
Reply


Thread Tools
Display Modes

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:30.


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