Raised This Month: $ Target: $400
 0% 

[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-16-2014 , 16:49   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #31

Quote:
Originally Posted by Sev View Post
Having trouble compiling the slay.sp code myself. 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;
}
I guess I forgot one important bit of info.

You shouldn't be compiling slay.sp, as it is merely an include file for playercommands, which is what you should recompile instead.

Just edit slay.sp, save the changes, and recompile playercommands, and the ragdoll slay should be working.
__________________
DeathChaos25 is offline
Sev
Veteran Member
Join Date: May 2010
Old 09-16-2014 , 17:16   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #32

Ah thanks for the info, worked like a charm.
Sev is offline
kochiurun119
BANNED
Join Date: Sep 2014
Location: GB
Old 09-25-2014 , 22:34   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #33

Well, Have a bug , Survivor( 1 hit and black white) and SI pounced(Charger , Hunter , Jockey and Tank) He/She not die and continue Death Animation forever (When done if slay/kill or !csm)
kochiurun119 is offline
Send a message via ICQ to kochiurun119 Send a message via AIM to kochiurun119 Send a message via Yahoo to kochiurun119 Send a message via Skype™ to kochiurun119
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 09-26-2014 , 07:34   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #34

Quote:
Originally Posted by kochiurun119 View Post
Well, Have a bug , Survivor( 1 hit and black white) and SI pounced(Charger , Hunter , Jockey and Tank) He/She not die and continue Death Animation forever (When done if slay/kill or !csm)
!kill and !slay should be able to kill the survivors stuck in this bug, but I'll look into it and try to fix it as soon as I can, thank you for letting me know.

Also, just in case, are you using the latest version?
__________________

Last edited by DeathChaos25; 09-26-2014 at 09:18.
DeathChaos25 is offline
kochiurun119
BANNED
Join Date: Sep 2014
Location: GB
Old 09-28-2014 , 00:08   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #35

Oh , sorry , the update fix it , good work , nice you . But have a problem, Player ( Under 20hp and black white) auto die ( Not getting any damage any). It is a bug???
kochiurun119 is offline
Send a message via ICQ to kochiurun119 Send a message via AIM to kochiurun119 Send a message via Yahoo to kochiurun119 Send a message via Skype™ to kochiurun119
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 09-28-2014 , 04:44   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #36

Quote:
Originally Posted by kochiurun119 View Post
Oh , sorry , the update fix it , good work , nice you . But have a problem, Player ( Under 20hp and black white) auto die ( Not getting any damage any). It is a bug???
That's weird, I've never had that happen, I'll poke around and see.
__________________
DeathChaos25 is offline
kochiurun119
BANNED
Join Date: Sep 2014
Location: GB
Old 09-28-2014 , 07:45   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #37

Hm...Maybe because my plugins. But you can hlep me? https://forums.alliedmods.net/showthread.php?t=248980 tk
kochiurun119 is offline
Send a message via ICQ to kochiurun119 Send a message via AIM to kochiurun119 Send a message via Yahoo to kochiurun119 Send a message via Skype™ to kochiurun119
huynhnhatkhai
Junior Member
Join Date: Sep 2014
Old 10-12-2014 , 03:20   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #38

Quote:
Originally Posted by DeathChaos25 View Post
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.


Work like a charm. Now only enable ragdoll when fall from high place left :'j. Are there any chance to make it happen? and make survivor's death animation when he is dead by fall from high place?
huynhnhatkhai is offline
bazrael
Senior Member
Join Date: Jan 2010
Location: Where Lucy became superw
Old 12-03-2014 , 03:50   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #39

In the latest version, I always see discontinuous death animation like Francis in demostration video. I barely see fluent animation like other survivors in demo video. Why?
bazrael is offline
LoneBat
Senior Member
Join Date: Dec 2013
Location: China
Old 12-09-2014 , 13:37   Re: [L4D2] Restore Survivor Death Animations
Reply With Quote #40

This can also be used with Restore Ragdolls, right?
LoneBat 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 07:53.


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