Raised This Month: $ Target: $400
 0% 

[L4D2]How to detect special infection behavior stuck


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-22-2022 , 17:56   Re: [L4D2]How to detect special infection behavior stuck
Reply With Quote #4

If still actual, I used to use box bounding check:

PHP Code:
#include <sdktools>

public void OnPluginStart()
{
    
RegAdminCmd("sm_stuck"CmdCheckStuckADMFLAG_ROOT"Checks if client stuck");
}

public 
Action CmdCheckStuck(int clientint args)
{
    
PrintToChat(client"Stuck? %b"IsClientStuck(client));
    return 
Plugin_Handled;
}

stock bool IsClientStuck(int iClientfloat vOrigin[3] = {0.00.00.0})
{
    static 
float vMin[3], vMax[3];
    static 
Handle hTrace;
    static 
bool bHit;
    
bHit false;
    
GetClientMins(iClientvMin);
    
GetClientMaxs(iClientvMax);
    if( 
vOrigin[0] == 0.0 && vOrigin[1] == 0.0 && vOrigin[2] == 0.0 )
    {
        
GetClientAbsOrigin(iClientvOrigin);
    }
    
hTrace TR_TraceHullFilterEx(vOriginvOriginvMinvMaxMASK_PLAYERSOLIDTraceRayNoPlayersiClient);
    if (
hTrace != INVALID_HANDLE) {
        
bHit TR_DidHit(hTrace);
        
CloseHandle(hTrace);
    }
    return 
bHit;
}

public 
bool TraceRayNoPlayers(int entityint maskany data)
{
    if(
entity == data || (entity >= && entity <= MaxClients))
    {
        return 
false;
    }
    return 
true;

__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
 


Thread Tools
Display Modes

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 04:49.


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