Raised This Month: $ Target: $400
 0% 

Shot on ATTACK2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The Inhabitant Of Heavens
Member
Join Date: Aug 2011
Old 10-24-2011 , 17:42   Shot on ATTACK2
Reply With Quote #1

How to make a shot at ATTACK2?

weapon_xm1014

PHP Code:
public fw_CmdStart(iduc_handleseed)
{
    if ((!
is_user_alive(id) )
        return 
FMRES_IGNORED

    
if (get_user_weapon(id) == CSW_XM1014)
    {
        if ((
get_uc(uc_handleUC_Buttons) & IN_ATTACK2) && !(pev(idpev_oldbuttons) & IN_ATTACK2))
        {
            new 
xm1014 find_ent_by_owner(-1"weapon_xm1014"id)
            
ExecuteHam(Ham_Weapon_PrimaryAttackxm1014)
        }
    }
    return 
FMRES_HANDLED

This is not working
The Inhabitant Of Heavens is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 10-24-2011 , 17:48   Re: Shot on ATTACK2
Reply With Quote #2

PHP Code:
if(get_user_weapon(id) == CSW_XM1014
{
        
ExecuteHam(Ham_Weapon_PrimaryAttackid)

Stereo is offline
The Inhabitant Of Heavens
Member
Join Date: Aug 2011
Old 10-24-2011 , 18:45   Re: Shot on ATTACK2
Reply With Quote #3

server crashes

Last edited by The Inhabitant Of Heavens; 10-24-2011 at 18:46.
The Inhabitant Of Heavens is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-24-2011 , 19:06   Re: Shot on ATTACK2
Reply With Quote #4

Quote:
Originally Posted by Stereo View Post
PHP Code:
if(get_user_weapon(id) == CSW_XM1014
{
        
ExecuteHam(Ham_Weapon_PrimaryAttackid)

You need to pass the weapon entity id to that but it will not work for weapons, you can use it to toss a grenade, though.

The ammo reduces with each shot though no sound is played and it doesn't look like a shot is happening:
PHP Code:
public fw_CmdStart(iduc_handleseed)
{
    if ( !
is_user_aliveid ) )
        return 
FMRES_IGNORED
    
    
if ( get_user_weaponid ) == CSW_XM1014 )
    {
        if ( ( 
get_uc(uc_handleUC_Buttons) & IN_ATTACK2 ) && !( pevid pev_oldbuttons ) & IN_ATTACK2 ) )
        {
            
set_ucuc_handle UC_Buttons get_ucuc_handle UC_Buttons ) & ~IN_ATTACK2 );
            
            const 
m_pActiveItem 373;
            new 
iWeaponEnt get_pdata_cbaseid m_pActiveItem );
            
            
ExecuteHamHam_Weapon_PrimaryAttack iWeaponEnt );
        }
    }
    
    return 
FMRES_HANDLED

__________________

Last edited by Bugsy; 10-24-2011 at 20:04.
Bugsy is offline
The Inhabitant Of Heavens
Member
Join Date: Aug 2011
Old 11-04-2011 , 04:50   Re: Shot on ATTACK2
Reply With Quote #5

Bugsy,thank you very much!

How to make a shot on ATTACK 2 (weapon_usp) as the automatic machine?

Quote:
if ((get_uc(uc_handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2))
{
PrimanyAttack ( id )
}

Quote:
public PrimanyAttack( Player )
{
new test = find_ent_by_owner(-1, "weapon_usp", Player)

ExecuteHam( Ham_Weapon_PrimaryAttack , test );

play_anim ( Player, random_num( 5 , 6 ) )
}
....

Last edited by The Inhabitant Of Heavens; 11-04-2011 at 04:50.
The Inhabitant Of Heavens is offline
The Inhabitant Of Heavens
Member
Join Date: Aug 2011
Old 11-04-2011 , 13:57   Re: Shot on ATTACK2
Reply With Quote #6

There are no ideas?
The Inhabitant Of Heavens is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-04-2011 , 14:23   Re: Shot on ATTACK2
Reply With Quote #7

You want it to fire like a machine gun when pressing attack 2?
__________________
Bugsy is offline
The Inhabitant Of Heavens
Member
Join Date: Aug 2011
Old 11-04-2011 , 14:29   Re: Shot on ATTACK2
Reply With Quote #8

I want that shooting was all time keeping ATTACK2 (weapon usp)

Last edited by The Inhabitant Of Heavens; 11-04-2011 at 14:30.
The Inhabitant Of Heavens is offline
Old 11-05-2011, 09:37
The Inhabitant Of Heavens
This message has been deleted by The Inhabitant Of Heavens.
Old 11-05-2011, 17:32
The Inhabitant Of Heavens
This message has been deleted by The Inhabitant Of Heavens.
The Inhabitant Of Heavens
Member
Join Date: Aug 2011
Old 11-06-2011 , 10:46   Re: Shot on ATTACK2
Reply With Quote #9

How to make pistols shoot when player is holding a primary attack button.Usually to make pistol fire you have to press attack button all the time
The Inhabitant Of Heavens is offline
Reply


Thread Tools
Display Modes

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 14:20.


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