Ok, here is a simple way to do it. I have a global array (set up in the same order they are for CSW_* constants) You can take this array and copy and paste and change the v_ to p_ and another for w_ so you have all three if you like, this was just an example. I gave you two ways of doing this, one through engine like you had it, and the other through FM (if you are planning on doing w_ models you need to use FM anyway)
Code:
enum {
DefModel = 0,
CSSModel
}
new g_szViewModels[MAX_WEAPONS][2][] =
{
{"",""},
{"models/v_p228.mdl","models/CSS/v_p228.mdl"},
{"",""},
{"models/v_scout.mdl","models/CSS/v_scout.mdl"},
{"models/v_hegrenade.mdl","models/CSS/v_hegrenade.mdl"},
{"models/v_xm1014.mdl","models/CSS/v_xm1014.mdl"},
{"models/v_c4.mdl","models/CSS/v_c4.mdl"},
{"models/v_mac10.mdl","models/CSS/v_mac10.mdl"},
{"models/v_aug.mdl","models/CSS/v_aug.mdl"},
{"models/v_smokegrenade.mdl","models/CSS/v_smokegrenade.mdl"},
{"models/v_elite.mdl","models/CSS/v_elite.mdl"},
{"models/v_fiveseven.mdl","models/CSS/v_fiveseven.mdl"},
{"models/v_ump45.mdl","models/CSS/v_ump45.mdl"},
{"models/v_sg550.mdl","models/CSS/v_sg550.mdl"},
{"models/v_galil.mdl","models/CSS/v_galil.mdl"},
{"models/v_famas.mdl","models/CSS/v_famas.mdl"},
{"models/v_usp.mdl","models/CSS/v_usp.mdl"},
{"models/v_glock.mdl","models/CSS/v_glock.mdl"},
{"models/v_awp.mdl","models/CSS/v_awp.mdl"},
{"models/v_mp5.mdl","models/CSS/v_mp5.mdl"},
{"models/v_m249.mdl","models/CSS/v_m249.mdl"},
{"models/v_m3.mdl","models/CSS/v_m3.mdl"},
{"models/v_m4a1.mdl","models/CSS/v_m4a1.mdl"},
{"models/v_tmp.mdl","models/CSS/v_tmp.mdl"},
{"models/v_g3sg1.mdl","models/CSS/v_g3sg1.mdl"},
{"models/v_flashbang.mdl","models/CSS/v_flashbang.mdl"},
{"models/v_deagle.mdl","models/CSS/v_deagle.mdl"},
{"models/v_sg552.mdl","models/CSS/v_sg552.mdl"},
{"models/v_ak47.mdl","models/CSS/v_ak47.mdl"},
{"models/v_knife.mdl","models/CSS/v_knife.mdl"},
{"models/v_p90.mdl","models/CSS/v_p90.mdl"}
}
//.....
public Event_CurWeapon(id)
{
if(!is_user_alive(id))
return PLUGIN_CONTINUE
//Engine
entity_set_string(id, EV_SZ_viewmodel, g_szViewModels[read_data(2)][(hasModels[id]) ? CSSModel : DefModel] )
//FM
set_pev(id, pev_viewmodel2, g_szViewModels[read_data(2)][(hasModels[id]) ? CSSModel : DefModel] )
return PLUGIN_CONTINUE
}