AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get Attack2 (https://forums.alliedmods.net/showthread.php?t=94373)

TitANious 06-10-2009 13:30

Get Attack2
 
This is from help from SnoW, i didn't knew how to get attack2, so my question is. Is it good enough to be used in there, where it's been used.
The code is provided here:
PHP Code:

public zp_extra_item_selected iditemid )
{
    if ( 
itemid == g_itemid_ak47 )
    {
        if ( ( 
is_user_alive id ) ) && ( zp_get_user_ammo_packs id ) <= get_pcvar_num pCvarCost ) ) )
        {
            
zp_set_user_ammo_packs idzp_get_user_ammo_packs id ) - get_pcvar_num pCvarCost ) )
            
give_item id"weapon_ak47");
            
cs_set_user_bpammo idCSW_AK4790 );
            
client_print idprint_chat"%s You got your AK47"PREFIX );
            
HasAK47id ] = true
        
}
        else if ( 
HasAK47id ] == true 
        {
            
client_print idprint_chat"%s You allready bought AK47"PREFIX );
        }
        else 
        {
            
client_print idprint_chat"%s You need %d Ammo Packs"PREFIX,  get_pcvar_num pCvarCost ) );
            
HasAK47id ] = false;
        }
        if ( 
pev idpev_button ) & IN_ATTACK2 // It's here
        
{
            
cs_set_user_zoom idCS_SET_FIRST_ZOOM)
            
HasZoomid ] = true
        
}
        else if( 
HasZoomid ] )
        {

            
HasZoomid ] = false
            cs_set_user_zoom
idCS_RESET_ZOOM)
        }
    }



Arkshine 06-10-2009 13:38

Re: Get Attack2
 
No. To trigger Attack2, use Ham_Weapon_SecondaryAttack or FM_CmdStart.

TitANious 06-10-2009 13:39

Re: Get Attack2
 
Hmm, okay. Thanks, it was this, that was easyier :)


All times are GMT -4. The time now is 13:50.

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