Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result)
- {
- if (!IsValidClient(client, false) || !Enabled) return Plugin_Continue;
- // HHH can climb walls
- if (IsValidEntity(weapon) && Special == VSHSpecial_HHH && client == Hale && HHHClimbCount <= 9 && VSHRoundState > 0)
- {
- new index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
- if (index == 266 && StrEqual(weaponname, "tf_weapon_sword", false))
- {
- SickleClimbWalls(client, weapon);
- WeighDownTimer = 0.0;
- HHHClimbCount++;
- }
- }
- if (client == Hale)
- {
- if (VSHRoundState != 1) return Plugin_Continue;
- if (TF2_IsPlayerCritBuffed(client)) return Plugin_Continue;
- if (!haleCrits)
- {
- result = false;
- return Plugin_Changed;
- }
- }
- else if (IsValidEntity(weapon))
- {
- new index = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
- if (index == 232 && StrEqual(weaponname, "tf_weapon_club", false))
- {
- SickleClimbWalls(client, weapon);
- }
- }
- return Plugin_Continue;
- }
- public Action:Timer_NoAttacking(Handle:timer, any:ref)
- {
- new weapon = EntRefToEntIndex(ref);
- SetNextAttack(weapon, 1.56);
- }
- stock SetNextAttack(weapon, Float:duration = 0.0)
- {
- if (weapon <= MaxClients) return;
- if (!IsValidEntity(weapon)) return;
- new Float:next = GetGameTime() + duration;
- SetEntPropFloat(weapon, Prop_Send, "m_flNextPrimaryAttack", next);
- SetEntPropFloat(weapon, Prop_Send, "m_flNextSecondaryAttack", next);
- }
- public SickleClimbWalls(client, weapon) //Credit to Mecha the Slag
- {
- if (!IsValidClient(client) || (GetClientHealth(client)<=15) )return;
- decl String:classname[64];
- decl Float:vecClientEyePos[3];
- decl Float:vecClientEyeAng[3];
- GetClientEyePosition(client, vecClientEyePos); // Get the position of the player's eyes
- GetClientEyeAngles(client, vecClientEyeAng); // Get the angle the player is looking
- //Check for colliding entities
- TR_TraceRayFilter(vecClientEyePos, vecClientEyeAng, MASK_PLAYERSOLID, RayType_Infinite, TraceRayDontHitSelf, client);
- if (!TR_DidHit(INVALID_HANDLE)) return;
- new TRIndex = TR_GetEntityIndex(INVALID_HANDLE);
- GetEdictClassname(TRIndex, classname, sizeof(classname));
- if (!StrEqual(classname, "worldspawn")) return;
- decl Float:fNormal[3];
- TR_GetPlaneNormal(INVALID_HANDLE, fNormal);
- GetVectorAngles(fNormal, fNormal);
- if (fNormal[0] >= 30.0 && fNormal[0] <= 330.0) return;
- if (fNormal[0] <= -30.0) return;
- decl Float:pos[3];
- TR_GetEndPosition(pos);
- new Float:distance = GetVectorDistance(vecClientEyePos, pos);
- if (distance >= 100.0) return;
- new Float:fVelocity[3];
- GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
- fVelocity[2] = 600.0;
- TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
- SDKHooks_TakeDamage(client, client, client, 15.0, DMG_CLUB, GetPlayerWeaponSlot(client, TFWeaponSlot_Melee));
- if (client != Hale) ClientCommand(client, "playgamesound \"%s\"", "player\\taunt_clip_spin.wav");
- CreateTimer(0.0, Timer_NoAttacking, EntIndexToEntRef(weapon), TIMER_FLAG_NO_MAPCHANGE);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement