Raised This Month: $51 Target: $400
 12% 

CS:GO Glock Right-Click Hook?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
imburnt916
Junior Member
Join Date: Apr 2015
Location: California
Old 09-08-2016 , 14:33   CS:GO Glock Right-Click Hook?
Reply With Quote #1

Hello, I am wondering if there is a way to hook the alternate firing of a glock (where it switches from auto to burst). Would weapon_zoom or weapon_zoom_rifle work?
__________________
Sourcemod developer and server manager.
imburnt916 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 09-08-2016 , 14:37   Re: CS:GO Glock Right-Click Hook?
Reply With Quote #2

OnplayerRunCmd IN_ATTACK2 within the Buttons would be when a player holds the right mouse button.
Mitchell is offline
imburnt916
Junior Member
Join Date: Apr 2015
Location: California
Old 09-08-2016 , 14:55   Re: CS:GO Glock Right-Click Hook?
Reply With Quote #3

Quote:
Originally Posted by Mitchell View Post
OnplayerRunCmd IN_ATTACK2 within the Buttons would be when a player holds the right mouse button.
Ahh thanks
__________________
Sourcemod developer and server manager.
imburnt916 is offline
imburnt916
Junior Member
Join Date: Apr 2015
Location: California
Old 09-08-2016 , 15:12   Re: CS:GO Glock Right-Click Hook?
Reply With Quote #4

Quote:
Originally Posted by Mitchell View Post
OnplayerRunCmd IN_ATTACK2 within the Buttons would be when a player holds the right mouse button.
Any way you could help me out checking for if its a glock? I was trying to use StrEqual(weapon, "weapon_glock") and it returns an error.
__________________
Sourcemod developer and server manager.
imburnt916 is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 09-08-2016 , 15:36   Re: CS:GO Glock Right-Click Hook?
Reply With Quote #5

You first have to make sure the weapon entity is valid and then use GetEntityClassname to get the weapon's name to compare to.
__________________
Peace-Maker is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-09-2016 , 02:48   Re: CS:GO Glock Right-Click Hook?
Reply With Quote #6

Using m_iItemDefinition is a bit quicker as you dont need to compare strings
__________________
Neuro Toxin is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 09-09-2016 , 09:41   Re: CS:GO Glock Right-Click Hook?
Reply With Quote #7

You could try hooking the sound. I think it's more efficient than checking in OnPlayerRunCmd().
__________________
hleV is offline
Reply



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 12:08.


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