4040
4141/* Defines */
4242#define PLUGIN_AUTHOR " PigPig"
43- #define PLUGIN_VERSION " 0.0.18d "
43+ #define PLUGIN_VERSION " 0.0.18e "
4444
4545
4646#include <sourcemod>
@@ -398,6 +398,7 @@ void SetPlayerFBMode(client, bool fbmode)
398398}
399399public Action :Event_OnTakeDamage (client , & attacker , & inflictor , & Float :damage , & damagetype , & weapon , Float :damageForce [3 ], Float :damagePosition [3 ], damagecustom )
400400{
401+
401402 if (! IsTestModeActive )
402403 return Plugin_Continue ;
403404
@@ -406,9 +407,37 @@ public Action:Event_OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &
406407 damage = 0.0 ; // do no damage to telefragged client.
407408 return Plugin_Changed ;
408409 }
409-
410+ new wepindex = (IsValidEntity (weapon ) && weapon > MaxClients ? GetEntProp (weapon , Prop_Send , " m_iItemDefinitionIndex" ) : - 1 );
411+ switch (wepindex )
412+ {
413+ case 656 : //Holiday Punch
414+ {
415+ CreateTimer (0.1 , Timer_StopTickle , GetClientUserId (client ), TIMER_FLAG_NO_MAPCHANGE );
416+ SetNextAttack (weapon , 4.0 );
417+ return Plugin_Changed ;
418+ }
419+ }
420+
410421 return Plugin_Continue ;
411422}
423+
424+ /*
425+ Stolen from VSH
426+ */
427+ stock SetNextAttack (weapon , Float :duration = 0.0 )
428+ {
429+ if (weapon <= MaxClients ) return ;
430+ if (! IsValidEntity (weapon )) return ;
431+ new Float :next = GetGameTime () + duration ;
432+ SetEntPropFloat (weapon , Prop_Send , " m_flNextPrimaryAttack" , next );
433+ SetEntPropFloat (weapon , Prop_Send , " m_flNextSecondaryAttack" , next );
434+ }
435+ public Action :Timer_StopTickle (Handle :timer , any :userid )
436+ {
437+ new client = GetClientOfUserId (userid );
438+ if (! client || ! IsClientInGame (client ) || ! IsPlayerAlive (client )) return ;
439+ if (! GetEntProp (client , Prop_Send , " m_bIsReadyToHighFive" ) && ! IsValidEntity (GetEntPropEnt (client , Prop_Send , " m_hHighFivePartner" ))) TF2_RemoveCondition (client , TFCond_Taunting );
440+ }
412441/*
413442 Use: Force a player to respawn
414443*/
@@ -1602,4 +1631,4 @@ void PopulateSpawnList()
16021631 PushArrayString (SpawnPointEntIDs , entstring );
16031632 }
16041633 }
1605- }
1634+ }
0 commit comments