Raised This Month: $32 Target: $400
 8% 

[L4D2] Restore Survivor Death Animations (UPDATED 03-29-2015)


Post New Thread Reply   
 
Thread Tools Display Modes
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 09-08-2014 , 19:41   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #21

Updated the plugin, however, the plugin unload/refresh bug is still there, how very persistent and annoying :/

Edit : Squashed like the bug that it was!
(pun intended)

Edit 2 : So, uh.

I was in the middle of testing out a newer version of this plugin, and, I think I broke the survivor bots.

Success?

And they willingly did it themselves too, they weren't weapon locked (you can see Louis switch between the molotov and the Hunting Rifle a few times), so yeah, definitely broke them.
__________________

Last edited by DeathChaos25; 09-09-2014 at 07:17.
DeathChaos25 is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 09-10-2014 , 06:37   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #22

Version 1.2 is out.

Hopefully, now players shouldn't be able to do any actions during their Death Animations except turn around their camera.
__________________
DeathChaos25 is offline
Sev
Veteran Member
Join Date: May 2010
Old 09-11-2014 , 17:30   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #23

Was wondering if this could be used in partnership with Mr. Zero's Ragdoll plugin, so the ragdolls will cover all deaths except for the death animations until they ragdoll post animation.

Otherwise, this plugin would need to be updated to accommodate the ragdoll death in all other scenarios, since as it stands now, it only covers with the death animation.

In other words, with ragdolls on, they only work with the death animation and not in other scenarios such as being pounced or instant killed by witches, etc.

Unless its that way by design.
Sev is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 09-11-2014 , 21:00   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #24

Quote:
Originally Posted by Sev View Post
Was wondering if this could be used in partnership with Mr. Zero's Ragdoll plugin, so the ragdolls will cover all deaths except for the death animations until they ragdoll post animation.

Otherwise, this plugin would need to be updated to accommodate the ragdoll death in all other scenarios, since as it stands now, it only covers with the death animation.

In other words, with ragdolls on, they only work with the death animation and not in other scenarios such as being pounced or instant killed by witches, etc.

Unless its that way by design.
Yes, by design, it's only accounting for Death Animations, you can use both plugins together effectively with no conflicts if you wish Ragdolls on every death possible (I do so myself).

The only death where you don't ragdoll (if using both plugins) is if you fall from a reasonable height that would insta kill you, since it doesn't trigger player_hurt.

Now that I think about it, I should edit the main post and suggest Mr.Zero's plugin for people who want ragdoll deaths everytime.
__________________
DeathChaos25 is offline
Sev
Veteran Member
Join Date: May 2010
Old 09-11-2014 , 21:02   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #25

Sounds good, thanks for the info.
Sev is offline
huynhnhatkhai
Junior Member
Join Date: Sep 2014
Old 09-12-2014 , 07:54   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #26

Ya, should enable ragdoll when death by fall from high place, and death by !kill, !explode, !suicide command :'D
huynhnhatkhai is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 09-12-2014 , 10:16   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #27

Quote:
Originally Posted by huynhnhatkhai View Post
Ya, should enable ragdoll when death by fall from high place, and death by !kill, !explode, !suicide command :'D
Those commands use ForcePlayerSuicide(), there is no possible way to account for that, the only way to have ragdoll deaths in those plugins, is to recompile and add this line;
PHP Code:
SetEntProp(clientProp_Send"m_isFallingFromLedge"1
In the plugin code for whatever command you want, look for ForcePlayerSuicide() and on the line above add the previously mentioned code, and you should get the desired results.

Let's look at slay.sp for example;
PHP Code:
PerformSlay(clienttarget)
{
    
LogAction(clienttarget"\"%L\" slayed \"%L\""clienttarget);
    
ForcePlayerSuicide(target);

Should be;
PHP Code:
PerformSlay(clienttarget)
{
    
LogAction(clienttarget"\"%L\" slayed \"%L\""clienttarget);
    
SetEntProp(targetProp_Send"m_isFallingFromLedge"1);
    
ForcePlayerSuicide(target);

Recompile, and whenever someone is slain via !slay, they will now ragdoll.

Hope this helps!
__________________
DeathChaos25 is offline
huynhnhatkhai
Junior Member
Join Date: Sep 2014
Old 09-12-2014 , 12:24   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #28

hm.... (` 0 ^0), tried to added that line, and got errors when compiling

//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// l4d_kill.sp
// E:\l4d2_ds\left4dead2\addons\sourcemod\script ing\l4d_kill.sp(41) : error 029:
invalid expression, assumed zero
// E:\l4d2_ds\left4dead2\addons\sourcemod\script ing\l4d_kill.sp(41) : warning 21
5: expression has no effect
// E:\l4d2_ds\left4dead2\addons\sourcemod\script ing\l4d_kill.sp(41) : error 001:
expected token: ";", but found "if"
//
// 2 Errors.
//
// Compilation Time: 0,2 sec
// ----------------------------------------

Press enter to exit ...



i used this plugin https://forums.alliedmods.net/showthread.php?p=2107510
huynhnhatkhai is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 09-12-2014 , 13:59   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #29

Quote:
Originally Posted by huynhnhatkhai View Post
hm.... (` 0 ^0), tried to added that line, and got errors when compiling

//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// l4d_kill.sp
// E:\l4d2_ds\left4dead2\addons\sourcemod\script ing\l4d_kill.sp(41) : error 029:
invalid expression, assumed zero
// E:\l4d2_ds\left4dead2\addons\sourcemod\script ing\l4d_kill.sp(41) : warning 21
5: expression has no effect
// E:\l4d2_ds\left4dead2\addons\sourcemod\script ing\l4d_kill.sp(41) : error 001:
expected token: ";", but found "if"
//
// 2 Errors.
//
// Compilation Time: 0,2 sec
// ----------------------------------------

Press enter to exit ...



i used this plugin https://forums.alliedmods.net/showthread.php?p=2107510
I had no problems getting it to compile with the change.
PHP Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "1.0"

public Plugin:myinfo 
    {
        
name "[L4D] Kill",
        
author "Danny & FlamFlam",
        
description "use the !kill command in chat",
        
version PLUGIN_VERSION,
        
url ""
    
}

    public 
OnPluginStart()
    {
        
RegConsoleCmd("sm_explode"Kill_Me);
        
RegConsoleCmd("sm_kill"Kill_Me);
    }


    
// kill
    
public Action:Kill_Me(clientargs)
    {
        
SetEntProp(clientProp_Send"m_isFallingFromLedge"1); 
        
ForcePlayerSuicide(client);
    }

    
//Timed Message
    
public bool:OnClientConnect(clientString:rejectmsg[], maxlen)

    {
        
CreateTimer(60.0Timer_Advertiseclient);
        return 
true;
    }

    public 
Action:Timer_Advertise(Handle:timerany:client)

    {
        if(
IsClientInGame(client))
        
PrintHintText(client"Type in chat !kill to kill yourself");
        else if (
IsClientConnected(client))
        
CreateTimer(60.0Timer_Advertiseclient);
    } 
And a pre-compiled version just in case.
Attached Files
File Type: smx l4d_kill.smx (3.2 KB, 120 views)
__________________
DeathChaos25 is offline
Sev
Veteran Member
Join Date: May 2010
Old 09-16-2014 , 16:17   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #30

Having trouble compiling the slay.sp code myself.
Quote:
SourcePawn Compiler 1.7.0-manual Copyright (c) 1997-2006 ITB CompuPhase Copyright (c) 2004-2014 AlliedModders LLC plugin.sp(3 : error 017: undefined symbol "ForcePlayerSuicide" plugin.sp(50) : error 017: undefined symbol "AddTargetsToMenu" plugin.sp(62) : error 017: undefined symbol "TopMenuAction_DisplayOption" plugin.sp(66) : error 017: undefined symbol "TopMenuAction_SelectOption" plugin.sp(80) : error 017: undefined symbol "hTopMenu" plugin.sp(82) : error 017: undefined symbol "DisplayTopMenu"
6 Errors.



Code:
/**
 * vim: set ts=4 :
 * =============================================================================
 * SourceMod Basefuncommands Plugin
 * Provides slay functionality
 *
 * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
 * =============================================================================
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, version 3.0, as published by the
 * Free Software Foundation.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * As a special exception, AlliedModders LLC gives you permission to link the
 * code of this program (as well as its derivative works) to "Half-Life 2," the
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
 * by the Valve Corporation.  You must obey the GNU General Public License in
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
 * this exception to all derivative works.  AlliedModders LLC defines further
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
 * or <http://www.sourcemod.net/license.php>.
 *
 * Version: $Id$
 */

PerformSlay(client, target)
{
    LogAction(client, target, "\"%L\" slayed \"%L\"", client, target);
    SetEntProp(target, Prop_Send, "m_isFallingFromLedge", 1);
    ForcePlayerSuicide(target);
}

DisplaySlayMenu(client)
{
    new Handle:menu = CreateMenu(MenuHandler_Slay);
    
    decl String:title[100];
    Format(title, sizeof(title), "%T:", "Slay player", client);
    SetMenuTitle(menu, title);
    SetMenuExitBackButton(menu, true);
    
    AddTargetsToMenu(menu, client, true, true);
    
    DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

public AdminMenu_Slay(Handle:topmenu, 
                      TopMenuAction:action,
                      TopMenuObject:object_id,
                      param,
                      String:buffer[],
                      maxlength)
{
    if (action == TopMenuAction_DisplayOption)
    {
        Format(buffer, maxlength, "%T", "Slay player", param);
    }
    else if (action == TopMenuAction_SelectOption)
    {
        DisplaySlayMenu(param);
    }
}

public MenuHandler_Slay(Handle:menu, MenuAction:action, param1, param2)
{
    if (action == MenuAction_End)
    {
        CloseHandle(menu);
    }
    else if (action == MenuAction_Cancel)
    {
        if (param2 == MenuCancel_ExitBack && hTopMenu != INVALID_HANDLE)
        {
            DisplayTopMenu(hTopMenu, param1, TopMenuPosition_LastCategory);
        }
    }
    else if (action == MenuAction_Select)
    {
        decl String:info[32];
        new userid, target;
        
        GetMenuItem(menu, param2, info, sizeof(info));
        userid = StringToInt(info);

        if ((target = GetClientOfUserId(userid)) == 0)
        {
            PrintToChat(param1, "[SM] %t", "Player no longer available");
        }
        else if (!CanUserTarget(param1, target))
        {
            PrintToChat(param1, "[SM] %t", "Unable to target");
        }
        else if (!IsPlayerAlive(target))
        {
            ReplyToCommand(param1, "[SM] %t", "Player has since died");
        }
        else
        {
            decl String:name[32];
            GetClientName(target, name, sizeof(name));
            PerformSlay(param1, target);
            ShowActivity2(param1, "[SM] ", "%t", "Slayed target", "_s", name);
        }
        
        DisplaySlayMenu(param1);
    }
}

public Action:Command_Slay(client, args)
{
    if (args < 1)
    {
        ReplyToCommand(client, "[SM] Usage: sm_slay <#userid|name>");
        return Plugin_Handled;
    }

    decl String:arg[65];
    GetCmdArg(1, arg, sizeof(arg));

    decl String:target_name[MAX_TARGET_LENGTH];
    decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
    
    if ((target_count = ProcessTargetString(
            arg,
            client,
            target_list,
            MAXPLAYERS,
            COMMAND_FILTER_ALIVE,
            target_name,
            sizeof(target_name),
            tn_is_ml)) <= 0)
    {
        ReplyToTargetError(client, target_count);
        return Plugin_Handled;
    }

    for (new i = 0; i < target_count; i++)
    {
        PerformSlay(client, target_list[i]);
    }
    
    if (tn_is_ml)
    {
        ShowActivity2(client, "[SM] ", "%t", "Slayed target", target_name);
    }
    else
    {
        ShowActivity2(client, "[SM] ", "%t", "Slayed target", "_s", target_name);
    }

    return Plugin_Handled;
}

Last edited by Sev; 09-16-2014 at 16:23.
Sev 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 23:35.


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