how to hook if player just shooted?
i was using prethink and then in_attack, but its inefficient since i want to hook each bullet not just pressing attack button
so anybody got an idea? i was thinking if i could mb hook weapon sounds thru FM_EmitSound but i can hook only knife sounds :/ |
Re: how to hook if player just shooted?
PlaybackEvent hook. This method is more accurate than CurWeapon and TraceLine methods.
Make sure that you don't take in account non-gun events like createsmoke, etc. In plugin_precache() hook PrecacheEvent and cache necessary event indeces. In plugin_init() unhook PrecacheEvent and hook PlaybackEvent. EDIT: You can review [HowTo] Properly catch shot event in CS |
Re: how to hook if player just shooted?
Which method is better ?
PlaybackEvent hook or Ham_Weapon_PrimaryAttack? Which one is called before other and which one would be better to control recoil ? |
Re: how to hook if player just shooted?
The first.
|
Re: how to hook if player just shooted?
Could you explain why ?
|
Re: how to hook if player just shooted?
PrimaryAttack is called a lot of times when you hold +attack/2 when the event is called only one time by bullet ; for your need it would be better to use the event.
|
| All times are GMT -4. The time now is 06:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.