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 client, int entity, int weapon, float 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 client, int 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[] name, bool 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", attacker, victim);
}
public Action L4D_OnShovedBySurvivor(int shover, int shovee, const float vecDir[3])
{
if (!IsSurvivor(shover) || !IsHunter(shovee) ) return Plugin_Continue;
PrintToChatAll("\x01%N Invoked \"L4D_OnShovedBySurvivor\x01 on \x03%N\x01", shover, shovee);
return Plugin_Handled;
}
public Action L4D2_OnEntityShoved(int client, int entity, int weapon, float 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", client, entity, bIsHighPounce);
return Plugin_Handled;
}
// check if client is on survivor team
bool IsSurvivor(int client)
{
return (client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2);
}
// check if client is on infected team
bool IsInfected(int client)
{
return (client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 3);
}
__________________