Raised This Month: $ Target: $400
 0% 

[SOLVED][TF2] Block Grappling hook when player stunned


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Research
SourceMod Donor
Join Date: Nov 2011
Old 05-08-2015 , 09:46   Re: [TF2] Block Grappling hook when player stunned
Reply With Quote #19

Quote:
Originally Posted by Chdata View Post
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(clientTFCond:condition)
{
   if(
GetClientTeam(client)==_:TFTeam_Red && condition==TFCond_Dazed)
   {
      new 
iHook GetPlayerWeaponSlot(clientTFWeaponSlot_Grapple);
      if (
iHook != -1SetEntPropFloat(iHookProp_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!
Research is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode