AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] minimal HUD (https://forums.alliedmods.net/showthread.php?t=134497)

greenlemonade 08-05-2010 12:24

[L4D2] minimal HUD
 
2 Attachment(s)
My first plugin. Very simple. Very short.
It hides the health display of all players who join server.
Spectators and Infected are unaffected.

Cvars:
// Hide health on the HUD of all players
// -
// Default: "1"
l4d2_hudhider_enable "1"

// Which game modes to enable Hud Hider
// -
// Default: "realism,teamversus,coop,mutation8,mutation12 "
l4d2_hudhider_modes "realism,teamversus,coop,mutation8,mutation12 "


Special thanks to McFlurry for showing me the ropes.


I tried making a feature that hid the entire HUD but this is currently not possible without requiring clients to bind keys to switch weapons and I don't want to mess with that and ruin a good thing.

3/24/2011
Update. Fixed the "client no in game" error.

smx below is up to date.

Thrawn2 08-05-2010 13:11

Re: [L4D2]minimal HUD
 
any reason you attached a compiled version?
also: you are missing the Plugin:myinfo part and you dont have a version cvar. and as a suggestion while you are at it: add a enable/disable cvar.

dirka_dirka 08-05-2010 13:23

Re: [L4D2]minimal HUD
 
you need the first 2 if your "releasing" a plugin

as has been mentioned 100000000000000001 times on these forums, you dont need IsClientConnected(i) && IsClientInGame(i)
if ingame then connected is already true.

Damizean 08-05-2010 14:34

Re: [L4D2]minimal HUD
 
Quote:

Originally Posted by dirka_dirka (Post 1262420)
you need the first 2 if your "releasing" a plugin

as has been mentioned 100000000000000001 times on these forums, you dont need IsClientConnected(i) && IsClientInGame(i)
if ingame then connected is already true.

I heard IsClientInGame returned fake positives sometimes, though.

dirka_dirka 08-05-2010 17:38

Re: [L4D2]minimal HUD
 
if its returning fake positives - its a bug and you should report it.. either that or just use isclientconnected and not both.

McFlurry 08-05-2010 20:06

Re: [L4D2]minimal HUD
 
And may I ask why you are using OnGameFrame()? :nono: You should just set this for each client on OnClientAuthorized(client)

greenlemonade 08-05-2010 20:23

Re: [L4D2]minimal HUD
 
My reasoning is I know nothing about Sourcemod plugins. Thanks for all your input. I'd like to learn.

I threw this together and was surprised that it actually worked after the 3rd time.

I suggested the minimal HUD plugin on forum and searched the internet for a day to see if it existed.

Would anyone be interested in taking the source material and sending me a revised version with a on off cvar ect.?

McFlurry 08-05-2010 20:37

Re: [L4D2]minimal HUD
 
1 Attachment(s)
I'd be happy to revise it for you.

Edit: revised version attached, look through source for cvars.

panxiaohai 08-05-2010 20:56

Re: [L4D2]minimal HUD
 
Just set hud when player spawn.

dirka_dirka 08-05-2010 22:21

Re: [L4D2]minimal HUD
 
actually.. ongameframe is a good place to set it.
otherwise theres nothing preventing the player from turning the hud back on.. just like in an old version of blind luck (which uses the exact same command) sometimes the hud wouldnt come back on - so you had to do it manually.

i guess he could do it on a timer every .1 seconds to save a few frames.. but either way, it should be constantly re-applied.


All times are GMT -4. The time now is 13:06.

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