Skip to content

Commit

Permalink
Hide buyback text for invaders
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikusch committed Feb 24, 2025
1 parent 2de6838 commit be25e8a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions addons/sourcemod/scripting/mitm/sdkhooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ void SDKHooks_OnEntityCreated(int entity, const char[] classname)
{
PSM_SDKHook(entity, SDKHook_Think, SDKHook_CTFTankBoss_Think);
}
else if (StrEqual(classname, "tf_player_manager"))
{
PSM_SDKHook(entity, SDKHook_ThinkPost, SDKHook_CTFPlayerResource_ThinkPost);
}
}

static Action SDKHook_CTFPlayer_OnTakeDamageAlive(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &weapon, float damageForce[3], float damagePosition[3], int damagecustom)
Expand Down Expand Up @@ -189,6 +193,21 @@ static Action SDKHook_CTFTankBoss_Think(int entity)
return Plugin_Continue;
}

static void SDKHook_CTFPlayerResource_ThinkPost(int manager)
{
for (int client = 1; client <= MaxClients; client++)
{
if (!IsClientInGame(client))
continue;

if (TF2_GetClientTeam(client) != TFTeam_Invaders)
continue;

// Hide buyback text for invaders
SetEntPropFloat(manager, Prop_Send, "m_flNextRespawnTime", 0.0, client);
}
}

Action SDKHookCB_EntityGlow_SetTransmit(int entity, int client)
{
int hEffectEntity = GetEntPropEnt(entity, Prop_Data, "m_hEffectEntity");
Expand Down

0 comments on commit be25e8a

Please sign in to comment.