Works, but after shooting while scoped, the user does not resume to being scoped. I personally like it this way.
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
new const Version[] = "0.1";
const ScopeWeapons = ( ( 1 << CSW_SCOUT ) | ( 1 << CSW_AWP ) | ( 1 << CSW_G3SG1 ) | ( 1 << CSW_SG550 ) );
const m_flNextPrimaryAttack = 46;
const m_pActiveItem = 373;
const XO_Player = 5;
const XO_Weapon = 4;
public plugin_init()
{
register_plugin( "No No-Scoping" , Version , "bugsy" );
register_event( "CurWeapon" , "CurWeapon" , "be" , "1=1" );
}
public CurWeapon( id )
{
if ( ScopeWeapons & ( 1 << read_data( 2 ) ) )
{
new iEntID = get_pdata_cbase( id , m_pActiveItem , XO_Player );
set_pdata_float( iEntID , m_flNextPrimaryAttack , ( cs_get_user_zoom( id ) < CS_SET_FIRST_ZOOM ) ? get_gametime() + 0.02 : 0.0 , XO_Weapon );
}
}
__________________