 |
|
SourceMod Donor
|

05-08-2015
, 09:46
Re: [TF2] Block Grappling hook when player stunned
|
#19
|
Quote:
Originally Posted by Chdata
doing that melee thing is even more work... and not what he asked for anyway.
The weapon switch check is entirely unnecessary towards you goal, as well as the onconditionremoved like michael said.
PHP Code:
#include <sourcemod> #include <tf2_stocks>
// TF2 Weapon Loadout Slots enum { TFWeaponSlot_DisguiseKit = 3, TFWeaponSlot_Construction = 3, TFWeaponSlot_Watch = 4, TFWeaponSlot_Destruction = 4, TFWeaponSlot_PDA = 5, // What? TFWeaponSlot_Grapple = 5 }
public TF2_OnConditionAdded(client, TFCond:condition) { if(GetClientTeam(client)==_:TFTeam_Red && condition==TFCond_Dazed) { new iHook = GetPlayerWeaponSlot(client, TFWeaponSlot_Grapple); if (iHook != -1) SetEntPropFloat(iHook, Prop_Send, "m_flNextPrimaryAttack", GetGameTime() + 12.0); } }
here ya go, you can probably compile this script as is and it'll do what you want.
|
Wait, grappling hook have own slot name? I trying to check grappling hook item number in onconditionadded :/
Anyway, Thanks for code!
|
|
|
|