[CSS] weapon_fire not good for pistols
If you're going to hook weapon_fire for pistols, DON'T DO IT!
The event gets called billions of times if the client holds his +attack button. Hook bullet_impact instead. Here an example from one of my plugins: Code:
BULLET_IMPACT IS CREDIT TO PLUGIN! |
Re: [CSS] weapon_fire not good for pistols
The same happens for the weapon_reload event >.<
|
Re: [CSS] weapon_fire not good for pistols
Use UserCmd or PlayerThink and check for ammo > lastAmmo to detect weapon reload :P
|
Re: [CSS] weapon_fire not good for pistols
you could do that for pistol fire aswell though.
in my weaponmod i have some code to test if the pistol actually fired. although i don't use weapon_fire as it doesn't detect knife stab i used client postthink which fires just before weapon_fire and manually check if the clients weapon fired. PHP Code:
|
Re: [CSS] weapon_fire not good for pistols
Quote:
|
Re: [CSS] weapon_fire not good for pistols
Sticky: Bug Thread: Non-Beta Issues #77
:3 *edit one more thing about bullet impact, bullets penetrate player or wall corners or through box will give multiple event.. Like fire one time you mayeb get lucky 4 bullet impact event fired. bad english |
Re: [CSS] weapon_fire not good for pistols
Fixed by Valve (15.09.2011)
Pistols no longer continuously spam weapon_fire event when the +attack key is pressed. This has the side effect of no longer allowing the glock to continuously auto-fire in burst mode). |
Re: [CSS] weapon_fire not good for pistols
Keep in mind, that bullet_impact is called everytime a bullet hits a surface. So if you shoot through a door or similar it'll fire twice with different x, y and z coordinates. Once at the door and at the wall behind it.
|
Re: [CSS] weapon_fire not good for pistols
weapon==special weapon, shouldnt that be a StrEqual?
|
Re: [CSS] weapon_fire not good for pistols
Quote:
|
Re: [CSS] weapon_fire not good for pistols
Yeah i was goi9ng to post back but i forgot, i just got the classname of that id and compared it to a string:
Code:
new weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"); |
| All times are GMT -4. The time now is 18:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.