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 ( id, itemid )
{
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 ( id, zp_get_user_ammo_packs ( id ) - get_pcvar_num ( pCvarCost ) )
give_item ( id, "weapon_ak47");
cs_set_user_bpammo ( id, CSW_AK47, 90 );
client_print ( id, print_chat, "%s You got your AK47", PREFIX );
HasAK47[ id ] = true
}
else if ( HasAK47[ id ] == true )
{
client_print ( id, print_chat, "%s You allready bought AK47", PREFIX );
}
else
{
client_print ( id, print_chat, "%s You need %d Ammo Packs", PREFIX, get_pcvar_num ( pCvarCost ) );
HasAK47[ id ] = false;
}
if ( pev ( id, pev_button ) & IN_ATTACK2 ) // It's here
{
cs_set_user_zoom ( id, CS_SET_FIRST_ZOOM, 1 )
HasZoom[ id ] = true
}
else if( HasZoom[ id ] )
{
HasZoom[ id ] = false
cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
}
}
}
__________________
I dislike this.
"A sneeze never comes alone!" <-- Important to remember.