AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D] HideHUDOnVomit (Blind Luck) (https://forums.alliedmods.net/showthread.php?t=84926)

grandwazir 02-03-2009 02:30

[L4D] HideHUDOnVomit (Blind Luck)
 
1 Attachment(s)
What does it do?

Have you noticed that your friends don't seem to have massive blue name plates above their heads? Isn't it annoying when survivors can just see through a boomer's vomit?


This plug-in has the answer. Blind Luck allows server administrators to temporarily remove part of a player's HUD to help simulate blindness. The majority of the HUD is removed except for weapon selection, the cross hair and chat area. While a survivor is blinded the health bars and name plates of other players are unavailable.

How do I use it?

Simply upload it and enjoy. Currently there are no in game commands although the mod is configurable through two ConVars. You can either choose to hide the HUD until the player is completely free of the vomit
, or only hide it for a specified time:-
  • bl_hide_until_dry: If true the mod will hide a player's UI until they are completely free of vomit.
  • bl_time: The amount of time to blind a player for if bl_hide_until_dry is false. Has no effect if bl_hide_until_dry is true.
  • bl_hud_to_apply: The bitmask to provide to hide_hud command. You can use this to hide whatever you like.
Sounds great! But is there anything wrong with it?

Not any more!
Thanks to olj and doku, we have worked out away to hide the HUD without spoofing sv_cheats. The new version has none of the limitations of the old one.

Last, but by no means least, The all knowing change log

Code:

* Version 1.0
*        - Initial release.
* Version 1.0.1
*        - Now works with sv_cheats off (thanks TESLA-X4 for the idea).
* Version 1.0.2
*        - Fixed the two ConVars so they no longer cause error messages in client consoles when connecting.
*        - Corrected some spelling mistakes in the comments that were bugging me.
* Version 1.0.3
*        - Fixed ArrayOutOfBounds error.
*        - Seperated Blind Luck configuation into cfg/sourcemod/plugin.blindluck
* Version 1.1.0
*        - No longer requires the spoofing of sv_cheats. This gets rid of the client messages.
*        - Added ConVar 'bl_hud_to_apply' to allow administrators to decide which parts of the HUD to hide.
*        - Event 'player_no_longer_it' is now unhooked when it is not needed.
*        - Added minimum and maximum values to 'bl_blind_time'. The maximum time is 25 seconds with the minimum being 5 seconds.
*        - Now compiles without indentation warnings.
* Version 1.1.1
*        - Fixed error message being logged whenrestoring the HUD on some entities.


djromero 02-03-2009 05:15

Re: [L4D] HideHUDOnVomit (Blind Luck)
 
1 Attachment(s)
Just rewrite the following function like this:

Code:

StripAndExecuteClientCommand(client, const String:command[], param) {
   
    // Removes sv_cheat flag from command
    new flags = GetCommandFlags(command);
    SetCommandFlags(command, flags & ~FCVAR_CHEAT);
   
    ClientCommand(client, "%s %d", command, param)
   
    // Restore sv_cheat flag on command
    SetCommandFlags(command, flags);

}

Now it won't require sv_cheats.

I took the liberty of posting the fixed plugin:

fr3akY 02-03-2009 05:34

Re: [L4D] HideHUDOnVomit (Blind Luck)
 
Nice plugin i tested it and it works perfectly without sv_cheats 1 :)

Thx ^^

grandwazir 02-03-2009 06:47

Re: [L4D] HideHUDOnVomit (Blind Luck)
 
I tried doing exactly that last night and the bloody thing would not work, I've tried your fix on my server and it still does not hide the HUD claiming sv_cheats is not on. It is odd it works for fr3aky and yourself but not for me :(

Something in my server.cfg maybe?

djromero 02-03-2009 11:59

Re: [L4D] HideHUDOnVomit (Blind Luck)
 
Quote:

Originally Posted by grandwazir (Post 754847)
I tried doing exactly that last night and the bloody thing would not work, I've tried your fix on my server and it still does not hide the HUD claiming sv_cheats is not on. It is odd it works for fr3aky and yourself but not for me :(

Something in my server.cfg maybe?

Nope, i don't think so, but if you have Kigen's Anti-cheat (or any other like it), this won't work.

If this is not the case, you could PM your server.cfg content (without passwords ;) ) and i'll give your a hand. A listing of your installed plugins will be usefull too.

Big Myke 02-03-2009 12:56

Re: [L4D] HideHUDOnVomit (Blind Luck)
 
I cannot get it to work unless cheats are enabled ='( I've used your hot fix too dj. Man, it works like a charm with cheats enabled, hopefully I can get it to work with cheats off soon ;)

djromero 02-03-2009 13:32

Re: [L4D] HideHUDOnVomit (Blind Luck)
 
Quote:

Originally Posted by Big Myke (Post 755055)
I cannot get it to work unless cheats are enabled ='( I've used your hot fix too dj. Man, it works like a charm with cheats enabled, hopefully I can get it to work with cheats off soon ;)

Hum, weird. Sure you don't have any anti-cheat plugin installed on your server??? For instance, Kigen's anti-cheat will hook (and stop) all commands that requieres sv_cheats at plugin startup, so even if you temporarily remove a command's flag later, the hook will be called and it won't allow the command to execute.

Big Myke 02-03-2009 13:50

Re: [L4D] HideHUDOnVomit (Blind Luck)
 
I placed the anti cheat in the disabled folder. Is there more that I need to do to disable the anti cheat? I can enable sv_cheats and the pluggin will work.

Update: I've removed additional pluggins and only had your hotfix pluggin enabled, DJ and it still does not work with sv_cheats set to 0

Fyren 02-03-2009 18:32

Re: [L4D] HideHUDOnVomit (Blind Luck)
 
Running an otherwise-default server with sv_cheats on is not safe. Using KAC may allow you to safely run with sv_cheats on (I haven't looked at it), but then your plugin apparently won't work anyway.

Sammy-ROCK! 02-03-2009 19:20

Re: [L4D] HideHUDOnVomit (Blind Luck)
 
Quote:

Originally Posted by djromero (Post 754813)
Just rewrite the following function like this:

Code:

StripAndExecuteClientCommand(client, const String:command[], param) {
   
    // Removes sv_cheat flag from command
    new flags = GetCommandFlags(command);
    SetCommandFlags(command, flags & ~FCVAR_CHEAT);
   
    ClientCommand(client, "%s %d", command, param)
   
    // Restore sv_cheat flag on command
    SetCommandFlags(command, flags);

}

Now it won't require sv_cheats.

I took the liberty of posting the fixed plugin:

This code wouldn't work unless you use FakeClientCommand.
Just because ClientCommand makes the command in client's console while FakeClientCommand simulates the command as the client did in the same frame. FakeClientCommandEx simulates like FakeClientCommand but in the next frame.


All times are GMT -4. The time now is 08:44.

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