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.

McFlurry 08-05-2010 22:22

Re: [L4D2]minimal HUD
 
How would you execute SetEntProp through console?

dirka_dirka 08-06-2010 09:37

Re: [L4D2]minimal HUD
 
you use the command hidehud 0

Searcher64 08-06-2010 09:40

Re: [L4D2]minimal HUD
 
Shortest plugin I ever saw <3 10 lines

McFlurry 08-06-2010 15:57

Re: [L4D2]minimal HUD
 
Isn't hidehud a cheat command, I just tried using it.

dirka_dirka 08-06-2010 18:20

Re: [L4D2]minimal HUD
 
yes it is.. but either hidehud 0 isnt.. or hidehud 0 is ok when your hud is changed. i went thru this quite a bit back in l4d1 when blind luck was breaking the hud

sirphr 08-07-2010 00:32

Re: [L4D2]minimal HUD
 
Does this hide everything because this would be great for filming... Maybe a screenie?

dirka_dirka 08-07-2010 01:49

Re: [L4D2]minimal HUD
 
it hides the same stuff that blind luck does - which is not everything. if you hide everything, you can only change weapons with the keys they are bound to (1,2,3,4).

Cliffhanger 08-09-2010 17:44

Re: [L4D2]minimal HUD
 
I wrote the exact same thing for a friend recently and also tried to get it to hide the scoreboard for extra realism, apparently from the responses in the IRC you cannot hide the scoreboard no matter what =/.

I suggest you use the value 345 for the m_iHideHUD as it will hide the weapon selector and crosshair as well and also leave the chat box open.

greenlemonade 08-09-2010 21:07

Re: [L4D2]minimal HUD
 
First, Thanks McFlurry. When this Plugin is polished, you'll be in credits.

2nd.
I like the idea of making a timer. It need not be .1 seconds. It could be ever 20 seconds even. I think that would solve the performance issue.

I however am clueless. Here is the code. Can someone please tell me how to change it from on frame to every 20 seconds? It has to apply to ALL players on server.

#pragma semicolon 1
#include <sourcemod>

#define PLUGIN_VERSION "1.0"

new Handle:Enable;
new Handle:Modes;

public Plugin:myinfo =
{
name = "[L4D & L4D2] Hud Hider",
author = "greenlemonade/Edited by McFlurry",
description = "Removes HUD of players.",
version = PLUGIN_VERSION,
url = "N/A"
}

public OnPluginStart()
{
CreateConVar("l4d2_hudhider_version", PLUGIN_VERSION, "Hud Hider version", FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_DONTRECORD|FC VAR_REPLICATED);
Enable = CreateConVar("l4d2_hudhider_enable", "1", "Hud Hider enable?", FCVAR_PLUGIN);
Modes = CreateConVar("l4d2_hudhider_modes", "realism,teamversus", "Which game modes to enable Hud Hider", FCVAR_PLUGIN);
}

stock bool:IsAllowedGameMode()
{
decl String:gamemode[24], String:gamemodeactive[64];
GetConVarString(FindConVar("mp_gamemode"), gamemode, sizeof(gamemode));
GetConVarString(Modes, gamemodeactive, sizeof(gamemodeactive));
return (StrContains(gamemodeactive, gamemode) != -1);
}

public OnClientAuthorized(client, const String:auth[])
{
if(IsAllowedGameMode() && GetConVarInt(Enable) == 1)
{
if(IsClientConnected(client) && !IsFakeClient(client))
{
SetEntProp(client, Prop_Send, "m_iHideHUD", 64);
}
}
}

greenlemonade 08-09-2010 21:11

Re: [L4D2]minimal HUD
 
Cliffhanger,
I'm not a fan of 345 as it hides the crosshair. I dont think its very realistic because there are no iron sights in L4D.
I think it also disables weapon select and crashes client if they open MOTD.
Im not sure of this.

McFlurry 08-09-2010 23:50

Re: [L4D2]minimal HUD
 
2 Attachment(s)
Reworked my version which didn't seem to be working at all. Now uses 5 second timer.

ghosthunterfool 08-10-2010 00:47

Re: [L4D2]minimal HUD
 
how to disable the crosshair?

step 08-10-2010 01:45

Re: [L4D2]minimal HUD
 
I can't use hidehud on my game either. It says cheat protected.

Cliffhanger 08-10-2010 23:30

Re: [L4D2]minimal HUD
 
Quote:

Originally Posted by greenlemonade (Post 1266909)
Cliffhanger,
I'm not a fan of 345 as it hides the crosshair. I dont think its very realistic because there are no iron sights in L4D.
I think it also disables weapon select and crashes client if they open MOTD.
Im not sure of this.

I've actually been playing that with friends and found that without crosshairs its actually quite fun and difficult. also i dont seem to be having trouble with opening the MOTD with 345 set =/


Quote:

Originally Posted by ghosthunterfool (Post 1267013)
how to disable the crosshair?

You can't without editing the plugin.

ghosthunterfool 08-11-2010 06:04

Re: [L4D2]minimal HUD
 
can u help me rework one to disable the crosshair and the hud =D

greenlemonade 08-13-2010 13:10

Re: [L4D2]minimal HUD
 
Download mcfluries Plugin (the source).
Open it with:
http://download.cnet.com/Notepad/300...-10327521.html

Replace all instances of "hidehud 64" with "hidehud 345"

Then "compile" the source code into a plugin using this:
http://www.sourcemod.net/compiler.php

greenlemonade 08-13-2010 13:42

Re: [L4D2]minimal HUD
 
McFlurry,
Great job with the plugin.

However? why have you limited it to Realism? I actually use it on Campaign on my server.

My reasoning is I'm making an ultra realism mod and I dont think the damage resistance in Realism is at all realistic.
The zombies are human and getting shot in the heart with a sniper rifle should kill just about anyone.

Also, I feel Expert Realism has serious balance issues.
Like the Magnum is stronger than just about any primary weapon.

In real life, the Desert Eagle is a very poor weapon. Its just fun. That's what it was designed for and thats why no military uses it.

:)

McFlurry 08-13-2010 13:57

Re: [L4D2]minimal HUD
 
I included a modes cvar l4d2_hudhider_modes
Change it to coop,etc

Searcher64 08-16-2010 07:55

Re: [L4D2] minimal HUD
 
Can you upload the .SP File please? :|

Greaver 09-05-2010 20:36

Re: [L4D2] minimal HUD
 
I have a problem....while hiding the hud this also hides my sm_admin commands. I cant see them, i can press the 1,2,3,4 buttons but i dont see the sm_admin menu. Is there any way to fix that?

chinagreenelvis 10-14-2010 17:12

Re: [L4D2] minimal HUD
 
I really wish there was a way that this could only hide the floating blue player names and nothing else.

greenlemonade 10-21-2010 13:42

Re: [L4D2] minimal HUD
 
as do I. There is really only one way to do that and that is adding

sm_cvar sv_disable_glow_survivors 1

to your server config.

fpsbrian 10-21-2010 13:55

Re: [L4D2] minimal HUD
 
Quote:

Originally Posted by chinagreenelvis (Post 1324858)
I really wish there was a way that this could only hide the floating blue player names and nothing else.

I can, but it would be client side only... and it's not working after the last update :-\

step 10-21-2010 14:15

Re: [L4D2] minimal HUD
 
hud_targetid_name_height 9999

chinagreenelvis 10-23-2010 01:16

Re: [L4D2] minimal HUD
 
There should be a function in this plugin that restores the hud for an admin who has activated his or her admin list, and then removes it again when they zero out of it.

chinagreenelvis 10-23-2010 15:33

Re: [L4D2] minimal HUD
 
Quote:

Originally Posted by greenlemonade (Post 1331049)
as do I. There is really only one way to do that and that is adding

sm_cvar sv_disable_glow_survivors 1

to your server config.

Holy smokes, you're right! That's completely awesome.

greenlemonade 03-24-2011 12:15

Re: [L4D2] minimal HUD
 
Well there. Its been forever, but the plugin is updated to not error out when people leave server on multi.
We've tested this plugin and its quite fun. :)


All times are GMT -4. The time now is 01:54.

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