View Single Post
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 04-04-2021 , 18:38   Re: [TF2][HELP] How to detect market garden
Reply With Quote #4

Quote:
Originally Posted by StrikeR14 View Post
I'd use:

PHP Code:
bool InMarketAir[MAXPLAYERS+1];

public 
void OnPluginStart()
{
      
HookEvent("rocket_jump"RocketJumpedEventHookMode_Pre);
      
HookEvent("rocket_jump_landed"RocketJumpLandedEventHookMode_Post);
}

...

public 
Action RocketJumped(Handle event, const char[] namebool dontBroadcast)
{
    
InMarketAir[GetClientOfUserId(GetEventInt(event"userid"))] = true;
    return 
Plugin_Continue;
}

public 
Action RocketJumpLanded(Handle event, const char[] namebool dontBroadcast)
{
    
InMarketAir[GetClientOfUserId(GetEventInt(event"userid"))] = false;
    return 
Plugin_Continue;


On your SDK TakeDamage event, use if (InMarketAir[attacker]) with your m_iItemDefinitionIndex checks.
Not saying it won’t work, however, they already attempted to check if they were in the condition that is applied while rocket jumping.
ThatKidWhoGames is offline