View Single Post
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 10-17-2021 , 22:49   Re: [L4D & L4D2] Left 4 DHooks Direct (1.61) [05-Oct-2021]
Reply With Quote #489

Quote:
Originally Posted by HarryPotter View Post
silver, I have some problems in l4d1.
Basically, I try to use Plugin_Handled to block m2 deadstop on hunter.

PHP Code:
// Called for every single shovable and even some of the unshovable entities in the game
forward Action L4D2_OnEntityShoved(int clientint entityint weaponfloat vecDir[3], bool bIsHighPounce); 
In l4d1 windows and linux, Plugin_Handled is working but sometimes not.
When hunter is about to pounce and land straight on your head (see picture below), hunter can get deadstopped.


PHP Code:
// L4D2 only uses this on Special Infected. Blocks hunter dead stop
forward Action L4D_OnShovedBySurvivor(int clientint victim, const float vecDir[3]); 
In l4d1 windows and linux, Plugin_Handled is not working.
Hunter doesn't play stun animation, but hunter can't move and get stuck for few seconds.


this is part of my code
PHP Code:
HookEvent("player_shoved"Event_PlayerShoved);
public 
void Event_PlayerShoved(Event event, const char[] namebool dontBroadcast)
{
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    
int victim GetClientOfUserId(GetEventInt(event"userid"));
     if (!
IsSurvivor(attacker) || !IsHunter(victim) ) return;

     
PrintToChatAll("\x01%N Invoked \"Event_PlayerShoved\x01 on \x03%N\x01"attackervictim);
}

public 
Action L4D_OnShovedBySurvivor(int shoverint shovee, const float vecDir[3])
{

    if (!
IsSurvivor(shover) || !IsHunter(shovee) ) return Plugin_Continue;

    
PrintToChatAll("\x01%N Invoked \"L4D_OnShovedBySurvivor\x01 on \x03%N\x01"shovershovee);

    return 
Plugin_Handled;
}

public 
Action L4D2_OnEntityShoved(int clientint entityint weaponfloat vecDir[3], bool bIsHighPounce)
{
     if (!
IsSurvivor(client) || !IsHunter(entity))
         return 
Plugin_Continue;

     
PrintToChatAll("\x01%N Invoked \"L4D2_OnEntityShoved\x01 on \x03%N\x01, bIsHighPounce: %d"cliententitybIsHighPounce);
 
     return 
Plugin_Handled;
}

// check if client is on survivor team
bool IsSurvivor(int client)
{
    return (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2);
}

// check if client is on infected team
bool IsInfected(int client)
{
    return (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 3);

Left 4 Dead 2 had this problem too.
JLmelenchon is offline