Advertisement
Chdata

Untitled

Aug 3rd, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. public Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result)
  2. {
  3. if (!IsValidClient(client, false) || !Enabled) return Plugin_Continue;
  4.  
  5. // HHH can climb walls
  6. if (IsValidEntity(weapon) && Special == VSHSpecial_HHH && client == Hale && HHHClimbCount <= 9 && VSHRoundState > 0)
  7. {
  8. new index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
  9.  
  10. if (index == 266 && StrEqual(weaponname, "tf_weapon_sword", false))
  11. {
  12. SickleClimbWalls(client, weapon);
  13. WeighDownTimer = 0.0;
  14. HHHClimbCount++;
  15. }
  16. }
  17.  
  18. if (client == Hale)
  19. {
  20. if (VSHRoundState != 1) return Plugin_Continue;
  21. if (TF2_IsPlayerCritBuffed(client)) return Plugin_Continue;
  22. if (!haleCrits)
  23. {
  24. result = false;
  25. return Plugin_Changed;
  26. }
  27. }
  28. else if (IsValidEntity(weapon))
  29. {
  30. new index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
  31. if (index == 232 && StrEqual(weaponname, "tf_weapon_club", false))
  32. {
  33. SickleClimbWalls(client, weapon);
  34. }
  35. }
  36. return Plugin_Continue;
  37. }
  38. public Action:Timer_NoAttacking(Handle:timer, any:ref)
  39. {
  40. new weapon = EntRefToEntIndex(ref);
  41. SetNextAttack(weapon, 1.56);
  42. }
  43. stock SetNextAttack(weapon, Float:duration = 0.0)
  44. {
  45. if (weapon <= MaxClients) return;
  46. if (!IsValidEntity(weapon)) return;
  47. new Float:next = GetGameTime() + duration;
  48. SetEntPropFloat(weapon, Prop_Send, "m_flNextPrimaryAttack", next);
  49. SetEntPropFloat(weapon, Prop_Send, "m_flNextSecondaryAttack", next);
  50. }
  51. public SickleClimbWalls(client, weapon) //Credit to Mecha the Slag
  52. {
  53. if (!IsValidClient(client) || (GetClientHealth(client)<=15) )return;
  54.  
  55. decl String:classname[64];
  56. decl Float:vecClientEyePos[3];
  57. decl Float:vecClientEyeAng[3];
  58. GetClientEyePosition(client, vecClientEyePos); // Get the position of the player's eyes
  59. GetClientEyeAngles(client, vecClientEyeAng); // Get the angle the player is looking
  60.  
  61. //Check for colliding entities
  62. TR_TraceRayFilter(vecClientEyePos, vecClientEyeAng, MASK_PLAYERSOLID, RayType_Infinite, TraceRayDontHitSelf, client);
  63.  
  64. if (!TR_DidHit(INVALID_HANDLE)) return;
  65.  
  66. new TRIndex = TR_GetEntityIndex(INVALID_HANDLE);
  67. GetEdictClassname(TRIndex, classname, sizeof(classname));
  68. if (!StrEqual(classname, "worldspawn")) return;
  69.  
  70. decl Float:fNormal[3];
  71. TR_GetPlaneNormal(INVALID_HANDLE, fNormal);
  72. GetVectorAngles(fNormal, fNormal);
  73.  
  74. if (fNormal[0] >= 30.0 && fNormal[0] <= 330.0) return;
  75. if (fNormal[0] <= -30.0) return;
  76.  
  77. decl Float:pos[3];
  78. TR_GetEndPosition(pos);
  79. new Float:distance = GetVectorDistance(vecClientEyePos, pos);
  80.  
  81. if (distance >= 100.0) return;
  82.  
  83. new Float:fVelocity[3];
  84. GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
  85.  
  86. fVelocity[2] = 600.0;
  87.  
  88. TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
  89.  
  90. SDKHooks_TakeDamage(client, client, client, 15.0, DMG_CLUB, GetPlayerWeaponSlot(client, TFWeaponSlot_Melee));
  91.  
  92. if (client != Hale) ClientCommand(client, "playgamesound \"%s\"", "player\\taunt_clip_spin.wav");
  93.  
  94. CreateTimer(0.0, Timer_NoAttacking, EntIndexToEntRef(weapon), TIMER_FLAG_NO_MAPCHANGE);
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement