I had also fixed this at the time, what I wanted to do was put two different weapon models of different weapons on the same hero, what worked for me was the following:
PHP Code:
// Const de Models para ponerse
new const gBatItaca[] = "models/shmod/bat_itaca_v.mdl"
new const gBatItaca2[] = "models/shmod/bat_itaca_p.mdl"
new const gBatKnife[] = "models/shmod/batmanknife_v.mdl"
public plugin_init()
{
register_event("CurWeapon", "weapon_change1", "be", "1=1")
register_event("CurWeapon", "weapon_change2", "be", "1=1")
}
public plugin_precache()
{
precache_model("models/shmod/batmanknife_v.mdl")
precache_model("models/shmod/bat_itaca_v.mdl")
precache_model("models/shmod/bat_itaca_p.mdl")
}
public weapon_change1(id)
{
//do nothing if client does not have hero or sh is off
if ( !sh_is_active() || !gHasBatman[id] ) return
//the read data is reading the weapon the client has out
new weaponID = read_data(2)
//and if the client does not have the m4a1 out just do nothing
if (weaponID !=CSW_XM1014) return
switch_model(id)
if (read_data(3) == 0) {
//so if he is out of ammo just reload it
sh_reload_ammo(id, 2)
/*after the id I made a 1 number
look at the superheromod.inc and you will see this
0 - follow server sh_reloadmode CVAR
1 - continuous shooting, no reload
2 - fill the backpack (must reload)
3 - drop the gun and get a new one with full clip
That should explain it*/
}
}
public weapon_change2(id)
{
if ( !sh_is_active() || !gHasBatman[id] ) return
// esto es para qe no se pongan el model si usamos el escuditos de putos
new v_mdl[32]
Entvars_Get_String(id, EV_SZ_viewmodel, v_mdl, 31)
if ( containi(v_mdl, "v_shield_") != -1 ) return
new kweaponID = read_data(2)
//and if the client does not have the m4a1 out just do nothing
if (kweaponID !=CSW_KNIFE) return
switch_model(id)
}
switch_model(id)
{
//if the sh mod is off the client is dead or he does not have the hero we do not want to let him have the weapon model!
if (!sh_is_active() || !is_user_alive(id) ) return
//and now we check again if he still has the m4a1 out
if (get_user_weapon(id) == CSW_XM1014) {
//now he has all the requirements to have the weapon model so we also need to give it to him
set_pev(id, pev_viewmodel2, gBatItaca)
set_pev(id, pev_weaponmodel2, gBatItaca2)
}
if (get_user_weapon(id) == CSW_KNIFE) {
//now he has all the requirements to have the weapon model so we also need to give it to him
set_pev(id, pev_viewmodel2, gBatKnife)
}
}
shorten the code, to put only what I did, but the solution was to add another curweapon event, it is the solution that I found at the moment I don't know if there is another way