Doesn't work as well. Here:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#define m_pPlayer 41
#define m_flNextPrimaryAttack 46
#define XO_WEAPON 4
new const g_szWeapons[][] = { "weapon_awp", "weapon_scout", "weapon_g3sg1", "weapon_sg550" }
public plugin_init()
{
register_plugin("No Shoot Unless Scoped", "1.0", "OciXCrom @ alliedmods.net")
for(new i; i < sizeof(g_szWeapons); i++)
RegisterHam(Ham_Weapon_PrimaryAttack, g_szWeapons[i], "OnShootPre")
}
public OnShootPre(iEnt)
{
static id
id = get_pdata_cbase(iEnt, m_pPlayer, XO_WEAPON)
if(cs_get_user_zoom(id) < CS_SET_FIRST_ZOOM)
{
set_pdata_float(iEnt, m_flNextPrimaryAttack, 1.0, XO_WEAPON)
return HAM_SUPERCEDE
}
return HAM_IGNORED
}
__________________