Raised This Month: $51 Target: $400
 12% 

[L4D2] Request: Death Checking Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
knfes
Junior Member
Join Date: Jan 2010
Old 09-06-2010 , 23:36   [L4D2] Request: Death Checking Plugin
Reply With Quote #1

Just wondering if anyone could write a plugin that disables death check (director_no_death_check 1), and then enables death check (director_no_death_check 0) when everyone is killed (not incapacitated).
Thanks.
knfes is offline
Alex.
SourceMod Donor
Join Date: Sep 2010
Location: England
Old 09-07-2010 , 11:13   Re: [L4D2] Request: Death Checking Plugin
Reply With Quote #2

Try this:
PHP Code:
#include <sourcemod>
#include <sdktools>

public Plugin:myinfo =
{
    
name "L4D2 Death Checker",
    
author "Alex",
    
description "Disables survivor team death ending scenario. Will enable it again when everyone is dead. Hopefully.",
    
version "0.1",
    
url ""
};

new 
PlayersThatHaveDied[MAXPLAYERS];

public 
OnPluginStart()
{
    
SetConVarInt(FindConVar("director_no_death_check"), 1);
    
HookEvent("player_death"APlayerHasDied);
}

public 
APlayerHasDied(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
0;
    
PlayersThatHaveDied[client] = 1;
    for(new 
1<= MaxClientsi++){
        if(
== 0){
            if(
PlayersThatHaveDied[i] == 0){}
            else{
                
1;
            }
        }
    }
    
    if(
== 1){
        
SetConVarInt(FindConVar("director_no_death_check"), 0);
    }

It's not quite done yet. I should probably reset the PlayersThatHaveDied array on map start.

Is director_no_death_check reset to 0 every time you start a new map?

Last edited by Alex.; 09-07-2010 at 12:29.
Alex. is offline
knfes
Junior Member
Join Date: Jan 2010
Old 09-14-2010 , 20:25   Re: [L4D2] Request: Death Checking Plugin
Reply With Quote #3

Sorry, I was out for the last 5 or so days. Got to test it out, got several results.
First try: the command stayed at director_no_death_check 1 and didn't change, even though everyone died.

Second try: looked in the console to see if director_no_death_check was set to 1. It was, so I incapacitated everyone, then it just ended like it was set to 0.

Third try: It didn't change anything.
knfes is offline
Alex.
SourceMod Donor
Join Date: Sep 2010
Location: England
Old 09-15-2010 , 03:24   Re: [L4D2] Request: Death Checking Plugin
Reply With Quote #4

Okay, I'll look into this.
Alex. is offline
Death [GER]
Senior Member
Join Date: Mar 2010
Old 09-15-2010 , 03:50   Re: [L4D2] Request: Death Checking Plugin
Reply With Quote #5

Try this
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_deathchecktoggle.sp - 269 views - 746 Bytes)
__________________
Death [GER] is offline
λlsnana(H λ l f l i f e)
Member
Join Date: Jun 2010
Old 09-15-2010 , 12:33   Re: [L4D2] Request: Death Checking Plugin
Reply With Quote #6

Quote:
Originally Posted by Death [GER] View Post
Try this
Plugin failed to comply.
λlsnana(H λ l f l i f e) is offline
Send a message via MSN to λlsnana(H λ l f l i f e)
Alex.
SourceMod Donor
Join Date: Sep 2010
Location: England
Old 09-15-2010 , 17:10   Re: [L4D2] Request: Death Checking Plugin
Reply With Quote #7

Some don't compile properly on the forums.

It should compile with this: http://www.sourcemod.net/compiler.php
Alex. is offline
Alex.
SourceMod Donor
Join Date: Sep 2010
Location: England
Old 09-16-2010 , 11:33   Re: [L4D2] Request: Death Checking Plugin
Reply With Quote #8

Fix what? The forum compiler or his plugin? Plugin looks fine to me.
Alex. is offline
Death [GER]
Senior Member
Join Date: Mar 2010
Old 09-16-2010 , 11:37   Re: [L4D2] Request: Death Checking Plugin
Reply With Quote #9

Well i dont have L4D so.. im Sorry.. but yeah from the code it should work
__________________
Death [GER] is offline
knfes
Junior Member
Join Date: Jan 2010
Old 09-29-2010 , 10:51   Re: [L4D2] Request: Death Checking Plugin
Reply With Quote #10

That's strange, I compiled the plugin and got this error:

/home/groups/sourcemod/upload_tmp/phpS0LbnC.sp(1) : error 038: extra characters on line

1 Error.
knfes is offline
Reply



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 13:07.


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