PDA

View Full Version : How do i get rid of the lifedisplay in HL2 DM


Gate
02-10-2012, 13:15
I want to get rid of the lifedisplay(healthdisplay) in the bottom left corner... Someone of you know how?

Greez Gate

Peace-Maker
02-13-2012, 09:08
https://forums.alliedmods.net/showpost.php?p=748172&postcount=5

Try setting the HIDEHUD_HEALTH bit in a thinkpost hook.

Like this - requires SDK Hooks.
#include <sdkhooks>

// 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_BITCOUNT 12

public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_ThinkPost, Hook_ThinkPost);
}

public Hook_ThinkPost(entity)
{
SetEntProp(entity, Prop_Send, "m_iHideHUD", GetEntProp(entity, Prop_Send, "m_iHideHUD")|HIDEHUD_HEALTH);
}

Gate
02-13-2012, 15:49
Thank you so much :)
I'll try it out now ;)...

//
Sorry, it doesn't work...
I reloaded sm after installing SDK Hooks and it seems to run correctly...
Also the Plugin is running
Running the server on Windowns Vista.
This is the SDK Hooks i'm using (V 2.1.0)
http://forums.alliedmods.net/showthread.php?t=106748

//I just used this Code in a timer called after OnClientPutInServer... So now it works...
SetEntProp(Client, Prop_Send, "m_iHideHUD",HIDEHUD_HEALTH);

I'm just wounder about the fact that it works only there... If i call it in OnClientPutInServer it won't work...
If I'm using it in a Hook it won't work...


Greez Gate

Peace-Maker
02-13-2012, 19:02
Try executing it in player_spawn

Gate
02-14-2012, 08:33
Desn't work

I used this...


public OnClientPutInServer(Client)
{
//Some Code
StandartsSetzen(Client);
}

stock StandartsSetzen(Client)
{
//Some Code
Laden(Client);
}

public Laden(Client)
{
//Some Code
CreateTimer(0.6, hideit, Client);
}

public Action:hideit(Handle:Timer, any:Client)
{
SetEntProp(Client, Prop_Send, "m_iHideHUD",(HIDEHUD_CROSSHAIR + HIDEHUD_HEALTH));
}
And it works but only till his respawn...

//I added the timer in player_spawn and now it works fine

Bacardi
02-14-2012, 15:29
yeah, you need delay it. Here without sdkhooks
// 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_BITCOUNT 12

public OnPluginStart()
{
HookEvent("player_spawn", spawn);
}

public spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetEventInt(event, "userid");
CreateTimer(0.0, remove_hud_health, userid);
}

public Action:remove_hud_health(Handle:timer, any:userid)
{
new client = GetClientOfUserId(userid);
if(client != 0 && IsClientInGame(client))
{
SetEntProp(client, Prop_Send, "m_iHideHUD", GetEntProp(client, Prop_Send, "m_iHideHUD")|HIDEHUD_HEALTH);
}
}

Gate
02-14-2012, 16:04
Well I'm using it in a Plugin... I will use your check (if Client is 0);)

Thanks to you two ;)