Dunno about your problem, tested your plugin with no problem.
I would optimize it though, don't need to store the string, just store the string index instead.
Also, don't use switch if you have like 55 cases...
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
const iMaxSlots = 32;
new g_iWeaponModel[ iMaxSlots+1 ];
public plugin_init( )
{
register_plugin( "Zoomed Models Fix", "0.1.1", "DruX" );
register_event( "SetFOV" , "Event_SetFOV" , "be" );
// use new so the memory is free when you exit current function
new szWeaponName[ 20 ]; // weapon_smokegrenade = 19
for ( new i = CSW_P228; i <= CSW_P90; i++ )
{
if( get_weaponname( i, szWeaponName, charsmax( szWeaponName ) ) )
{
RegisterHam( Ham_Item_Deploy, szWeaponName, "HamFwd_Item_Deploy_Post", 1 );
}
}
}
public Event_SetFOV( id )
{
if ( get_user_weapon( id ) )
{
if( 0 < read_data(1) < 55 )
{
set_pev(id, pev_viewmodel, 0);
}
else if( !pev(id, pev_viewmodel) )
{
set_pev(id, pev_viewmodel, g_iWeaponModel[id]);
}
}
}
public HamFwd_Item_Deploy_Post( iEnt )
{
const XTRA_OFS_WEAPON = 4;
const m_pPlayer = 41;
new id = get_pdata_cbase( iEnt, m_pPlayer, XTRA_OFS_WEAPON );
g_iWeaponModel[id] = pev(id, pev_viewmodel);
}
__________________