Client.cpp
somewhere under (cvar.recoil)
add following: Code:
if (cvar.hbox_switch && me.alive) // && me.alive means, and if im alive ONLY. If dead, hbox_switch won't switch. Fixes minor performance issues.
{
if ( strstr("deagle",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_deagle");
}
if ( strstr("ak47",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_ak47");
}
if ( strstr("usp",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_usp");
}
if ( strstr("glock18",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_glock18");
}
if ( strstr("m4a1",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_m4a1");
}
if ( strstr("aug",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_aug");
}
if ( strstr("m3",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_m3");
}
if ( strstr("mp5",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_mp5");
}
if ( strstr("m249",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_m249");
}
if ( strstr("g3sg1",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_g3sg1");
}
if ( strstr("knife",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_knife");
}
if ( strstr("ump45",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_ump45");
}
if ( strstr("tmp",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_tmp");
}
if ( strstr("p90",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_p90");
}
if ( strstr("scout",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_scout");
}
if ( strstr("galil",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_galil");
}
if ( strstr("mac10",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_mac10");
}
if ( strstr("xm1014",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_xm1014");
}
if ( strstr("famas",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_famas");
}
if ( strstr("sg550",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_sg550");
}
if ( strstr("awp",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_awp");
}
if ( strstr("sg552",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_sg552");
}
if ( strstr("p228",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_p228");
}
if ( strstr("elite",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_elite");
}
if ( strstr("fiveseven",gGetWeaponName(me.ent->curstate.weaponmodel)) )
{
cmd.exec("hbox_fiveseven");
}