AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   CS:GO Glock Right-Click Hook? (https://forums.alliedmods.net/showthread.php?t=287490)

imburnt916 09-08-2016 14:33

CS:GO Glock Right-Click Hook?
 
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?

Mitchell 09-08-2016 14:37

Re: CS:GO Glock Right-Click Hook?
 
OnplayerRunCmd IN_ATTACK2 within the Buttons would be when a player holds the right mouse button.

imburnt916 09-08-2016 14:55

Re: CS:GO Glock Right-Click Hook?
 
Quote:

Originally Posted by Mitchell (Post 2452283)
OnplayerRunCmd IN_ATTACK2 within the Buttons would be when a player holds the right mouse button.

Ahh thanks

imburnt916 09-08-2016 15:12

Re: CS:GO Glock Right-Click Hook?
 
Quote:

Originally Posted by Mitchell (Post 2452283)
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.

Peace-Maker 09-08-2016 15:36

Re: CS:GO Glock Right-Click Hook?
 
You first have to make sure the weapon entity is valid and then use GetEntityClassname to get the weapon's name to compare to.

Neuro Toxin 09-09-2016 02:48

Re: CS:GO Glock Right-Click Hook?
 
Using m_iItemDefinition is a bit quicker as you dont need to compare strings

hleV 09-09-2016 09:41

Re: CS:GO Glock Right-Click Hook?
 
You could try hooking the sound. I think it's more efficient than checking in OnPlayerRunCmd().


All times are GMT -4. The time now is 01:12.

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