Thread: [Solved] null
View Single Post
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 07-05-2022 , 14:15   Re: [L4D2] Speed Booster
Reply With Quote #4

Thanks Marttt,

I tried to use HookEvent, because I want to disable it once charging start not necessary when charging a survivor

PHP Code:
    HookEvent ("charger_charge_start"Event_InfectedAbilityStart);
    
HookEvent ("charger_pummel_start"Event_InfectedAbilityStart);
    
HookEvent ("choke_start",     Event_InfectedAbilityStart);
    
HookEvent ("lunge_pounce"Event_InfectedAbilityStart);
    
HookEvent ("jockey_ride"Event_InfectedAbilityStart); 
I'm a bit confused with it, tried many ways but not sure how to make it work.

PHP Code:
public void Event_InfectedAbilityStart (Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId (event.GetInt("userid"));
    if (
client && IsClientInGame(client) && !IsFakeClient(client) && IsInfected(client))
    {
        
Speeding [client] = false;
        
SetEntPropFloat (clientProp_Data"m_flLaggedMovementValue"1.0);
    }
    return;

I tried different ways but still didnt work for me

Last edited by alasfourom; 07-07-2022 at 04:11.
alasfourom is offline