Raised This Month: $ Target: $400
 0% 

Check if he fired on PrimaryAttack post


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 11-30-2010 , 20:40   Re: Check if he fired on PrimaryAttack post
Reply With Quote #1

I'm actually doing this:

I hook PrimaryAttack on every weapon (excepting grenades knives and c4) on Pre and Post.

PHP Code:
public fw_Weapon_PrimaryAttack(iWeaponId)
{
    
g_bWeaponFiring true
}

public 
fw_Weapon_PrimaryAttack_Post(iWeaponId)
{
    
g_bWeaponFiring false
    
    
static iPlayer
    iPlayer 
get_pdata_cbase(iWeaponIdm_pPlayer4)
    
    if(
/*HAS BULLETS REMAINING*/)
    {
        
// DECREASE_REMAINING_BULLETS
    
}

g_bWeaponFiring works for catching on TraceAttack the damage caused by bullet. Here I apply the Special bullet effect.

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?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-01-2010 , 02:00   Re: Check if he fired on PrimaryAttack post
Reply With Quote #2

Why do you want to do exactly ? which feature i mean.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 12-01-2010 , 15:08   Re: Check if he fired on PrimaryAttack post
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Why do you want to do exactly ? which feature i mean.
That doesn't care. Btw, it's an ability called Hard Bullets. You can make knockback on each player.

Oh man who can help me? I no need other things, only need this answer and I'll gtfo of here.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:17.


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