AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Opposite of m_iHideHUD (https://forums.alliedmods.net/showthread.php?t=320361)

foon 12-18-2019 01:54

Opposite of m_iHideHUD
 
Is there a way to do the opposite of m_iHideHUD? I would like to force part of the hud on a player.

Balimbanana 12-24-2019 12:52

Re: Opposite of m_iHideHUD
 
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);
}



All times are GMT -4. The time now is 14:40.

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