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

[L4D & L4D2] Left 4 DHooks Direct (1.146) [21-Apr-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-10-2022 , 13:26   Re: [L4D & L4D2] Left 4 DHooks Direct (1.95) [10-Apr-2022]
Reply With Quote #671

Code:
1.95 (10-Apr-2022)
    - Added stock "GetRandomClient" in the "left4dhooks_silver.inc" include file.
    - Added forward "L4D_OnWitchSetHarasser" to fire when a Witch has been startled. Requested by "ProjectSky".
    - Added post hook forward "L4D_OnTryOfferingTankBot_Post" to compliment it's related forward "L4D_OnTryOfferingTankBot".

    - Fixed animation hooks not removing the detour when no longer required.
    - Fixed animation hooks not cleaning up when a client disconnects.
    - Fixed animation hooks triggering on clients other than those specified. Thanks to "JoinedSenses", "nosoop" and "Impact" for helping.
    - Fixed forward "L4D2_OnPummelVictim" bugging out the victim when blocking the pummel.
    - Fixed some description errors in the "left4dhooks.inc" include file. Thanks to "Eyal282" for reporting.
    - Fixed a compile warning in 1.11 from the "left4dhooks_silver.inc" include file.

    - Updated: Plugin and test plugin.
    - Updated: "left4dhooks.inc" and "left4dhooks_silver.inc" Include files.
    - Updated: "left4dhooks.l4d1.txt" and "left4dhooks.l4d2.txt" GameData files.
__________________
Silvers is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-10-2022 , 13:40   Re: [L4D & L4D2] Left 4 DHooks Direct (1.95) [10-Apr-2022]
Reply With Quote #672

Very cool! Thanks.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 04-11-2022 , 11:03   Re: [L4D & L4D2] Left 4 DHooks Direct (1.95) [10-Apr-2022]
Reply With Quote #673

PHP Code:
L 04/11/2022 22:57:16: [SMException reportedInvalid index 16 (count16)
L 04/11/2022 22:57:16: [SMBlamingleft4dhooks.smx
L 04
/11/2022 22:57:16: [SMCall stack trace:
L 04/11/2022 22:57:16: [SM]   [0ArrayList.Get
L 04
/11/2022 22:57:16: [SM]   [1Line 2753d:\Sourcemod\scripting\left4dhooks.sp::OnClientDisconnect 
After changing this part of the code, no error will be reported
PHP Code:
    int i;
    while( 
length )
    {
        
// Get hooked client
        
target g_iAnimationHookedPlugins.Get(i1);

        
// Verify client to unhook
        
if( client == target )
        {
            
g_iAnimationHookedPlugins.Erase(i);
            
length--;
        }
        else
            
i++;
    } 

Last edited by sorallll; 04-11-2022 at 11:27.
sorallll is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-11-2022 , 14:33   Re: [L4D & L4D2] Left 4 DHooks Direct (1.96) [11-Apr-2022]
Reply With Quote #674

Code:
1.96 (11-Apr-2022)
    - Fixed error on client disconnect. Thanks to "sorallll" for reporting.
__________________
Silvers is offline
Tonblader
Senior Member
Join Date: Jul 2011
Location: Peru
Old 04-13-2022 , 18:20   Re: [L4D & L4D2] Left 4 DHooks Direct (1.96) [11-Apr-2022]
Reply With Quote #675

Is it possible make a type of filter target, which uses the existing ones but within an area where you are looking?

Example:
@alltarget (all objectives in area in sphere of you crosshair point, but need to configure size of area)
@at500@s (all targets in sphere area with 500 size with condition @s target filter)
@at250@dead@!me (all targets in sphere area with 250 size with condition @dead and @!me targets filters)
@at1250@dead@s@!me (all targets in sphere area with 1250 size with condition @dead , @s and @!me targets filters)

Regardless of the previous idea, I think that if it is too complicated, can make the multitarget in 1 single target filter for now.
Example:

@dead@!me (all targets with condition @dead and @!me targets filters)
@dead@s@!me (all targets with condition @dead , @s and @!me targets filters)

Last edited by Tonblader; 04-13-2022 at 18:35.
Tonblader is offline
Red Flame
Junior Member
Join Date: Jan 2012
Old 04-13-2022 , 19:51   Re: [L4D & L4D2] Left 4 DHooks Direct (1.96) [11-Apr-2022]
Reply With Quote #676

Hello, after recent two updates servers started to crash because of the plugin which uses animation post-hook.
Red Flame is offline
fdxx
Member
Join Date: Oct 2020
Location: 0xdeadbeef
Old 04-13-2022 , 23:35   Re: [L4D & L4D2] Left 4 DHooks Direct (1.96) [11-Apr-2022]
Reply With Quote #677

Quote:
Originally Posted by Red Flame View Post
Hello, after recent two updates servers started to crash because of the plugin which uses animation post-hook.
Execute DHookDisableDetour inside DHookCallback, Will cause the server to crash.

l4d2_ellis_hunter_bandaid_fix:
PHP Code:
Action EllisPostPounce(int clientint &sequence)
{
    
// Ellis Hunter get up animation?
    
if (sequence == ANIM_ELLIS_HUNTER_GETUP)
    {
        
SDKHook(clientSDKHook_PostThinkPostUpdateThink);
        
AnimHookDisable(clientINVALID_FUNCTIONEllisPostPounce);
    }
    return 
Plugin_Continue;

left4dhooks:
PHP Code:
public int Native_AnimHookDisable(Handle pluginint numParams)
{
    .....
    
// Remove detour, no more plugins using it
    
if( length == && g_aDetoursHooked.Get(g_iAnimationDetourIndex) == )
    {
        
g_aForceDetours.Set(g_iAnimationDetourIndex0);
        
g_aDetoursHooked.Set(g_iAnimationDetourIndex0);

        
Handle hDetour g_aDetourHandles.Get(g_iAnimationDetourIndex);
        
DHookDisableDetour(hDetourfalseDTR_CBaseAnimating_SelectWeightedSequence_Pre);
        
DHookDisableDetour(hDetourtrueDTR_CBaseAnimating_SelectWeightedSequence_Post);
    }
    .....

fdxx is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 04-14-2022 , 00:13   Re: [L4D & L4D2] Left 4 DHooks Direct (1.96) [11-Apr-2022]
Reply With Quote #678

Quote:
Originally Posted by Silvers View Post
Code:
1.96 (11-Apr-2022)
    - Fixed error on client disconnect. Thanks to "sorallll" for reporting.
Hi Silvers. According to this code in your 1.96 update, you will skip some items
PHP Code:
// Loop through all anim hooks for specific client
    
int length g_iAnimationHookedPlugins.Length;

    for( 
int i 0lengthi++ )
    {
        
// Get hooked client
        
index g_iAnimationHookedPlugins.Get(i1);

        
// Verify client to unhook
        
if( client == index )
        {
            
g_iAnimationHookedPlugins.Erase(i);
            
length--;
        }
    } 
Here is the test code
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>

public Plugin myinfo=
{
    
name "l4d2 test",
    
author "",
    
description "",
    
version "",
    
url ""
}

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_test"cmdTestADMFLAG_ROOT);
}

public 
Action cmdTest(int clientint args)
{
    
ArrayList aTemp = new ArrayList();

    for (
int i10i++)
        
aTemp.Push(i);

    
int val;
    
int length aTemp.Length;
    for (
int jlengthj++)
    {
        
val aTemp.Get(j);
        
ReplyToCommand(client">>%d"val);

        if (
val == || val == || val == 7)
        {
            
aTemp.Erase(j);
            
length--;
        }
    }

    
delete aTemp;
    return 
Plugin_Handled;

After entering the test command it will output the following values
PHP Code:
>>0
>>1
>>2
>>3
>>5
>>7
>>
sorallll is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 04-14-2022 , 01:27   Re: [L4D & L4D2] Left 4 DHooks Direct (1.96) [11-Apr-2022]
Reply With Quote #679

Hello bro, I just updated and this forward is not working:
PHP Code:
 forward void L4D_OnMaterializeFromGhost(int client); 
Beatles is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-14-2022 , 09:23   Re: [L4D & L4D2] Left 4 DHooks Direct (1.96) [11-Apr-2022]
Reply With Quote #680

Quote:
Originally Posted by Tonblader View Post
Is it possible make a type of filter target, which uses the existing ones but within an area where you are looking?

---

Regardless of the previous idea, I think that if it is too complicated, can make the multitarget in 1 single target filter for now.
No, target filters are part of SM and does not support this.


Quote:
Originally Posted by Red Flame View Post
Hello, after recent two updates servers started to crash because of the plugin which uses animation post-hook.
Thanks, fixed for next version.


Quote:
Originally Posted by Beatles View Post
Hello bro, I just updated and this forward is not working:
PHP Code:
 forward void L4D_OnMaterializeFromGhost(int client); 
Thanks, due to changing the pre-post hook tracking it's messed everything up and I've spent hours trying to figure out a solution. Really stressful but finally think I got it working.

@Red Flame
@Beatles
Can I PM you the next version to test?
__________________

Last edited by Silvers; 04-14-2022 at 12:01.
Silvers 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 00:38.


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