Raised This Month: $52 Target: $400
 13% 

[L4D2] Black and White on Defib v1.0


Post New Thread Reply   
 
Thread Tools Display Modes
Skorpion1976
Veteran Member
Join Date: Jun 2009
Location: Austria
Old 04-30-2010 , 15:31   Re: [L4D2] Black and White on Defib v1.0
Reply With Quote #31

Quote:
Originally Posted by cigs View Post
Crimson, can you or anyone else confirm that the method the plugin uses to force someone to go into black and white mode doesn't work anymore since the DLC?
I can confirm that EVERY time a survivor gets resurrected the character sees everything in color so he/she does not know that he/she is b/w. I added an extra hint text (in the shop plugin, for the resurrection event) for all survivors:

Code:
...
    new target = GetClientOfUserId(GetEventInt(event, "subject"));
    GetClientName(target, PlayerName, sizeof(PlayerName));
       for (new i = 1; i <= MaxClients; i++)
        {
            if (!IsClientInGame(i))
            {
                continue;
            }
                   if (GetClientTeam(i) == 2)
            {
                PrintHintText(i, "%s is B/W and needs HEAL!",PlayerName);
            }
        }..

Last edited by Skorpion1976; 04-30-2010 at 15:39.
Skorpion1976 is offline
iNFiNiTeX
Senior Member
Join Date: Dec 2009
Old 04-30-2010 , 16:50   Re: [L4D2] Black and White on Defib v1.0
Reply With Quote #32

If I understand the last few post correctly, this plugin will no longer make a survivor see black & white after defib, even though they really are?

If thats the case, maybe you can adapt the code from the No Witch Hunting plugin, as it still works fine if you get slashed by a witch.

http://forums.alliedmods.net/showthread.php?p=1003810
iNFiNiTeX is offline
Skorpion1976
Veteran Member
Join Date: Jun 2009
Location: Austria
Old 05-01-2010 , 18:24   Re: [L4D2] Black and White on Defib v1.0
Reply With Quote #33

is it about this line here ? Can someone merge the code from no-witch-hunt plugin into this one here ?

Code:
SetEntProp(client,Prop_Send,"m_currentReviveCount",g_iSurvivorMaxIncapCount - 1);
Skorpion1976 is offline
Kringe
Junior Member
Join Date: Feb 2010
Old 05-02-2010 , 09:23   Re: [L4D2] Black and White on Defib v1.0
Reply With Quote #34

Thanks guys!

Was fighting this same problem in another plugin, and was able to work out a solution (i think, bug tests to begin...) after reading about the no-witch-hunt plugin. I'm very grateful. Particularly to those who write all the code in the first place.

It seemed to me that there were about 10 lines of essential code, but I'm not much as far as writing code goes. I'm all cut & paste. My apologies if I offend anyone, but hopefully this is helpful.

I used the two variables:

Code:
new Handle:g_hSurvivorMaxIncapCount;
new g_iSurvivorMaxIncapCount = 2;
three lines of code for the "OnPluginStart()" section

Code:
g_hSurvivorMaxIncapCount = FindConVar("survivor_max_incapacitated_count");
HookConVarChange(g_hSurvivorMaxIncapCount, CvarChanged_IncapCount);
HookEvent("player_incapacitated_start", Event_WitchIncap);
It should be noted that I had the HookEvent with something other than "Event_WitchIncap", but it doesn't matter as long as the next lines are in a section with the same name. I really should learn what I'm talking about some day.

Also, the line mentioned in a previous post inserted right above the section named by HookEvent:

Code:
public CvarChanged_IncapCount(Handle:convar, const String:oldValue[], const String:newValue[]){g_iSurvivorMaxIncapCount = StringToInt(newValue);}
And finally, in the aforementioned section referenced by the HookEvent:

Code:
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new count = GetEntProp(client,Prop_Send,"m_currentReviveCount");
if(count > g_iSurvivorMaxIncapCount - 1){return;}
SetEntProp(client,Prop_Send,"m_currentReviveCount",g_iSurvivorMaxIncapCount - 1);
Well, I think that's everything. Good luck with it! Again, Credit to Mr. Zero.
Kringe is offline
iNFiNiTeX
Senior Member
Join Date: Dec 2009
Old 05-06-2010 , 14:38   Re: [L4D2] Black and White on Defib v1.0
Reply With Quote #35

Has anyone had any success with the above code? If so could they share their work? I wouldn't know how to adapt this as I have yet to dabble in the arts of coding.
iNFiNiTeX is offline
iNFiNiTeX
Senior Member
Join Date: Dec 2009
Old 06-11-2010 , 06:50   Re: [L4D2] Black and White on Defib v1.0
Reply With Quote #36

Really hoping someone could fix this. I do not wish to entirely remove defibs but leaving them as they are makes the game too easy on the survivors part in my opinion. Being brought back to life and not seeing bw does create confusion in my game and it is frustrating sometimes. The only alternative would be to lower the number of defibs in the game and I'm not looking forward to doing that.
iNFiNiTeX is offline
ghosthunterfool
Senior Member
Join Date: Mar 2010
Old 07-02-2010 , 09:07   Re: [L4D2] Black and White on Defib v1.0
Reply With Quote #37

can someone fix this?
ghosthunterfool is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 07-02-2010 , 13:27   Re: [L4D2] Black and White on Defib v1.0
Reply With Quote #38

One has nothing to do with the other. Valve changed the way the HUD is updated, apparently it now only happens if you get revived. So unless you actually get downed and revived, you simply dont get the BW view.

...

Ill have a _short_ look on how this works in the Source.



EDIT:

Server just checks the convar value on revive and starts the Hearbeat Sound if youre down to your last life, i fear the BW handling is clientside only.

Last edited by AtomicStryker; 07-02-2010 at 13:32.
AtomicStryker is offline
iNFiNiTeX
Senior Member
Join Date: Dec 2009
Old 07-05-2010 , 21:19   Re: [L4D2] Black and White on Defib v1.0
Reply With Quote #39

I see, well that sucks. Thanks for looking into it.
iNFiNiTeX is offline
Crimson_Fox
Senior Member
Join Date: Mar 2009
Old 07-16-2010 , 18:36   Re: [L4D2] Black and White on Defib v1.0
Reply With Quote #40

I think having the client run a cl_fullupdate would do the trick; but since it's a client-side command with a cheat flag, I have no idea how this would be done.
Crimson_Fox is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode