Ham_Weapon_SecondaryAttack on elites, for example
Is it possible to make Ham_Weapon_SecondaryAttack working for weapons that haven't zoom or silencer?
I just put this code and it doesn't display the print PHP Code:
Some way to make it possible? Just a offset or something? |
Re: Ham_Weapon_SecondaryAttack on elites, for example
https://github.com/s1lentq/ReGameDLL.../wpn_elite.cpp
Elites don't have a secondary attack registered. (as in, the method SecondaryAttack) Your options are either use a custom version of ReGameDLL to add this method, or hook the button attack2 while the player is holding the elites. |
Re: Ham_Weapon_SecondaryAttack on elites, for example
1. Ham_Weapon_SecondaryAttack is called just for weapons who already have an secondary attack as GabbyIggy told you ( Zoom, USP-Silencer, Glock/Famasa/Galil Shoot burst style, etc. )
2. The good way of dealing with index is doing: PHP Code:
Code:
bind mouse2 "+myoption" |
Re: Ham_Weapon_SecondaryAttack on elites, for example
Quote:
Quote:
What would probably be the best thing to do is to hook bool CBasePlayerWeapon::HasSecondaryAttack() and to return true from it. You can hook it with Orpheu, Okapi or ReAPI. |
Re: Ham_Weapon_SecondaryAttack on elites, for example
Quote:
But yeah, hooking HasSecondaryAttack and altering the return value is by far the best and safest way in case the function is not copied by the compiler where it's used. It's called only from ItemPostFrame, and from what I saw while working with similar functions, some times the compiler just copy/paste the function, so hooking it does nothing, because the original function is never called. If this is the case, then hooking ItemPostFrame and handling that function at a plugin level(redoing the code) would be the solution. |
Re: Ham_Weapon_SecondaryAttack on elites, for example
Best way is hooking HasSecondaryAttack as Klippy said, but you also can do it the way how game actually does it too
Code:
public plugin_init() |
Re: Ham_Weapon_SecondaryAttack on elites, for example
What I said basically.
|
Re: Ham_Weapon_SecondaryAttack on elites, for example
@nihi, did you test if is working?
|
Re: Ham_Weapon_SecondaryAttack on elites, for example
Quote:
Quote:
|
Re: Ham_Weapon_SecondaryAttack on elites, for example
Quote:
|
| All times are GMT -4. The time now is 23:00. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.