Check if he fired on PrimaryAttack post
I'm trying to find the best method of how know if the player fired, catching the event on Ham's PrimaryAttack. It's like the M3: If the player is underwater, PrimaryAttack is called but doesn't fire a bullet bcoz the engine blocks the shotgun's attack when player is underwater.
I thought in this methods, hope someone can tell me another one better than mines: 1) Check if EF_MUZZLEFLASH is on player's pev_effect 2) Use a global bar, and store ammo amount on PrimaryAttack pre. Then in PrimaryAttack post check if current bullets are different from global variable's value. Thanks in advance. |
Re: Check if he fired on PrimaryAttack post
Quote:
Quote:
|
Re: Check if he fired on PrimaryAttack post
Do you only want to use Ham? This method works good http://forums.alliedmods.net/showthread.php?t=54887
|
Re: Check if he fired on PrimaryAttack post
I'm actually doing this:
I hook PrimaryAttack on every weapon (excepting grenades knives and c4) on Pre and Post. PHP Code:
So, the weird thing is that not always when the engine calls PrimaryAttack, a gun is fired. So some special bullets will be lose. So we're here now. Asking how to know if the gun fired. I think detecting EF_MUZZLEFLASH on player's effect entvar will be a solution. What do you think? |
Re: Check if he fired on PrimaryAttack post
Why do you want to do exactly ? which feature i mean.
|
Re: Check if he fired on PrimaryAttack post
Quote:
Oh man who can help me? I no need other things, only need this answer and I'll gtfo of here. |
Re: Check if he fired on PrimaryAttack post
See the 2 first answers... :roll:
|
Re: Check if he fired on PrimaryAttack post
Quote:
|
Re: Check if he fired on PrimaryAttack post
Why do you need to use Ham_PrimaryAttack?
|
Re: Check if he fired on PrimaryAttack post
Quote:
|
| All times are GMT -4. The time now is 11:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.