Not tested
Code:
#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta >
new const VALID_WEAPONS[ ][ ] = {
"weapon_awp",
"weapon_scout",
"weapon_g3sg1",
"weapon_sg550"
}
public plugin_init( ) {
register_plugin( "Block Shoot Unless Scoped", "1.0", "DoNii" );
for ( new i; i < sizeof VALID_WEAPONS; i++ )
RegisterHam( Ham_Weapon_PrimaryAttack, VALID_WEAPONS[ i ], "fw_HamPrimaryAttack" );
}
public fw_HamPrimaryAttack( ent ) {
if( pev_valid( ent ) != 2 )
return HAM_IGNORED;
new id = pev( ent, pev_owner );
new zoom = cs_get_user_zoom( id );
if( ( zoom == CS_RESET_ZOOM ) || ( zoom == CS_SET_NO_ZOOM ) )
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
__________________