AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D, L4D2] No Death Check Until Dead (https://forums.alliedmods.net/showthread.php?t=142432)

Skorpion1976 11-08-2010 13:23

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Quote:

Originally Posted by DieTeetasse (Post 1344203)
The events are also invoked for common infected, which have no clientid, because they are entities and therefore no team.

Does this mean that the check for team 2 or team 3 is not enough o_O ?

DieTeetasse 11-08-2010 17:17

Re: [L4D] & [L4D2] No Death Check Until Dead
 
@Skorpion1976:
No, it's not enough. Always check against client == 0 or check with IsClientInGame(client) ;)

@chinagreenelvis:
You are right, commons do not have anything to do with players, but in fact the event player_death is also fired for common infected (god knows why...). (Not sure for player_hurt.)

AtomicStryker 11-08-2010 17:30

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Because player_death is a generic source event that applies for all CBaseCombatCharacters (including commons)

chinagreenelvis 11-08-2010 17:34

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Ah, okay, thanks guys. I'll see if I can't whip this into shape.

chinagreenelvis 11-09-2010 04:38

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Eleven hours later and I came up with a fix. It's going to require a lot more coding, however, to make sure all the events are being considered.

It seems to be dependent entirely upon setting the convar, resetting it, and then setting it again only at specific points like incapacitation. The player_death event is the most finicky, since using it to reset the convar requires that the action not be preceded by any calculations.

All in all, what should be very simple is extremely ridiculous and complicated.

Does anyone know if it's possible to force the "mission_lost" event? Or to in any way force the survivors to lose the round? If so, that would make this much simpler.

Skorpion1976 11-09-2010 13:53

Re: [L4D] & [L4D2] No Death Check Until Dead
 
You can post here http://forums.alliedmods.net/forumdisplay.php?f=60

chinagreenelvis 11-13-2010 22:38

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Update posted.

The new version should solve the problem of the mission being lost if all remaining players are incapped when one person dies. However, it doesn't seem to work properly until the mission is restarted. The first time all players are dead, the death-check doesn't manage to end the mission. I have no idea why and if anyone can figure out how to fix it, I'd greatly appreciate it.

chinagreenelvis 11-13-2010 23:06

Re: [L4D] & [L4D2] No Death Check Until Dead
 
Nevermind, it's been fixed. As far as I can tell, it works perfectly now.

chinagreenelvis 11-14-2010 21:01

Re: [L4D, L4D2] No Death Check Until Dead
 
Minor error corrected. It still wasn't working properly but I believe it should be now.

Skorpion1976 11-15-2010 12:27

Re: [L4D, L4D2] No Death Check Until Dead
 
Quote:

Originally Posted by chinagreenelvis (Post 1349690)
Minor error corrected. It still wasn't working properly but I believe it should be now.

1. What is this supposed to do on a 10vs10 server ?
2. Why is MissionWillBeLost true if DeadGuys = 3?
3. Why do you consider a bot as "DeadGuy" ?

PHP Code:

DeadCheck()
{
    new 
DeadGuys 0
    for(new 
1<= MaxClientsi++) 
    { 
        if (
IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == 2
        { 
            if (!
IsPlayerAlive(i) || IsFakeClient(i)) 
            {     
                
DeadGuys++; 
            } 
        } 
    } 
     
    if (
DeadGuys == 3)
    { 
        
MissionWillBeLost true;
    }
    else 
    { 
        
MissionWillBeLost false;
    } 




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

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