cf单机吧 关注:896贴子:4,158
  • 0回复贴,共1
#include <amxmodx>
#include <hamsandwich>
#include<fakemeta>
#include<suic_weapon>




// stock m_iClientFOV = 364 // int
// stock m_iFOV = 363 // int
// stock m_pActiveItem = 373; // CBasePlayerItem *
new nowWpn[64];
new nowName[64];
static const WeaponEnt[][] =
{
""/* "weapon_none" */, "weapon_p228",""/* "weapon_none" */, "weapon_scout","weapon_hegrenade","weapon_xm1014",
""/* "weapon_c4" */, "weapon_mac10","weapon_aug", "weapon_smokegrenade","weapon_elite", "weapon_fiveseven",
"weapon_ump45", "weapon_sg550","weapon_galil","weapon_famas", "weapon_usp", "weapon_glock18",
"weapon_awp", "weapon_mp5navy","weapon_m249","weapon_m3", "weapon_m4a1", "weapon_tmp",
"weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552","weapon_ak47", "weapon_knife",
"weapon_p90"//,
}


// Weapon bitsums
static const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
static const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)


// new g_MsgSetFOV,iMsg_TextMsg;


public plugin_init()
{
register_plugin("Deploy","1.0","lein@live.cn");



for (new i = 1; i < sizeof WeaponEnt; i++)
{
if(!WeaponEnt[i][0])
continue

if (PRIMARY_WEAPONS_BIT_SUM & (1<<i))
{
RegisterHam(Ham_Item_Deploy, WeaponEnt[i], "Primary_Deploy", 1);
continue;
}
else if (SECONDARY_WEAPONS_BIT_SUM & (1<<i))
{
RegisterHam(Ham_Item_Deploy, WeaponEnt[i], "Secondary_Deploy", 1);
continue;
}

}

// RegisterHam(Ham_Item_Deploy, "weapon_ak47", "Awp_Deploy_Post", 1);
// RegisterHam(Ham_Item_Holster, "weapon_ak47", "Awp_Holster_Post", 1);

//Knife
RegisterHam(Ham_Item_Deploy,"weapon_knife", "Knife_Deploy",1);
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "Knife_Attack" );

//He
RegisterHam(Ham_Item_Deploy, "weapon_hegrenade","Grenade_Deploy", 1);
RegisterHam(Ham_Item_Deploy, "weapon_smokegrenade","Grenade_Deploy", 1);
RegisterHam(Ham_Item_Deploy, "weapon_flashbang","Grenade_Deploy", 1);

}




public Knife_Attack(iEntity)
{
if(!pev_valid(iEntity))
return HAM_IGNORED;

new id = pev(iEntity, pev_owner);
if (!is_user_alive(id))
return HAM_IGNORED;
// if (is_user_zombie(id))
// return HAM_IGNORED;


// client_print(id,print_chat,"[chat] id %d | iEntity %d",id,iEntity);

return HAM_HANDLED;
// return HAM_SUPERCEDE;
}


public Primary_Deploy(iEntity)
{
if(!pev_valid(iEntity))
{
return HAM_IGNORED;
}
new id = pev(iEntity, pev_owner);
if (is_user_alive(id) && !is_user_bot(id))
{
SuicGetPlayerWpnNow(id,nowWpn,nowName);
if(!strcmp(nowName, "M4A1-雷神"))
{
client_cmd(id, "tp_fov 57");
client_cmd(id, "tp_fe_r 107");
client_cmd(id, "tp_fe_g 137");
client_cmd(id, "tp_fe_b 233");
client_cmd(id, "tp_fe_x 90");
client_cmd(id, "tp_fe_y 120");
}else if(!strcmp(nowName, "AK47-火麒麟"))
{
client_cmd(id, "tp_fov 45");
client_cmd(id, "tp_fe_r 255");
client_cmd(id, "tp_fe_g 0");
client_cmd(id, "tp_fe_b 0");
client_cmd(id, "tp_fe_x 0");
client_cmd(id, "tp_fe_y 0");
}else if(!strcmp(nowName, "M4A1-黑骑士"))
{
client_cmd(id, "tp_fov 46");
client_cmd(id, "tp_fe_r 255");
client_cmd(id, "tp_fe_g 0");
client_cmd(id, "tp_fe_b 0");
client_cmd(id, "tp_fe_x 60");
client_cmd(id, "tp_fe_y 85");
}else if(!strcmp(nowName, "AK47-黑武士"))
{
client_cmd(id, "tp_fov 46");
client_cmd(id, "tp_fe_r 255");
client_cmd(id, "tp_fe_g 0");
client_cmd(id, "tp_fe_b 0");
client_cmd(id, "tp_fe_x 80");
client_cmd(id, "tp_fe_y 50");
}else if(!strcmp(nowName, "M4A1-黑龙"))
{
client_cmd(id, "tp_fov 45");
client_cmd(id, "tp_fe_r 255");
client_cmd(id, "tp_fe_g 0");
client_cmd(id, "tp_fe_b 0");
client_cmd(id, "tp_fe_x 80");
client_cmd(id, "tp_fe_y 80");
}else if(!strcmp(nowName, "AK12-天启"))
{
client_cmd(id, "tp_fov 57.8");
}else if(!strcmp(nowName, "M4A1-死神"))
{
client_cmd(id, "tp_fov 43.3");
}else if(!strcmp(nowName, "M82A1-毁灭"))
{
client_cmd(id, "tp_fov 45");
client_cmd(id, "tp_fe_r 255");
client_cmd(id, "tp_fe_g 0");
client_cmd(id, "tp_fe_b 0");
client_cmd(id, "tp_fe_x 50");
client_cmd(id, "tp_fe_y 80");
}else if(!strcmp(nowName, "M4A1-千变"))
{
client_cmd(id, "tp_fov 48");
client_cmd(id, "tp_fe_r 104");
client_cmd(id, "tp_fe_g 193");
client_cmd(id, "tp_fe_b 237");
client_cmd(id, "tp_fe_x 50");
client_cmd(id, "tp_fe_y 70");
}else if(!strcmp(nowName, "AK47-A"))
{
client_cmd(id, "tp_fov 50");
}else if(!strcmp(nowName, "AN94-超新星"))
{
client_cmd(id, "tp_fov 57");
}else if(!strcmp(nowName, "M4A1-S"))
{
client_cmd(id, "tp_fov 48");

}else if(!strcmp(nowName, "AK47-CFS"))
{
client_cmd(id, "tp_fov 45");

}else if(!strcmp(nowName, "Barrett-M82A1"))
{
client_cmd(id, "tp_fov 44");
}else if(!strcmp(nowName, "M82A1-极光"))
{
client_cmd(id, "tp_fov 55");
}else if(!strcmp(nowName, "王者之光"))
{
client_cmd(id, "tp_fov 55");
}else if(!strcmp(nowName, "王者之影"))
{
client_cmd(id, "tp_fov 45");
}else if(!strcmp(nowName, "AWM-天龙"))
{
client_cmd(id, "tp_fov 45");
client_cmd(id, "tp_fe_r 255");
client_cmd(id, "tp_fe_g 0");
client_cmd(id, "tp_fe_b 0");
client_cmd(id, "tp_fe_x 120");
client_cmd(id, "tp_fe_y 120");
}else if(!strcmp(nowName, "AK47-无影"))
{
client_cmd(id, "tp_fov 45");
client_cmd(id, "tp_fe_r 104");
client_cmd(id, "tp_fe_g 193");
client_cmd(id, "tp_fe_b 237");
client_cmd(id, "tp_fe_x 50");
client_cmd(id, "tp_fe_y 70");
}else if(!strcmp(nowName, "M240B-苍雷"))
{
client_cmd(id, "tp_fov 45");
}else if(!strcmp(nowName, "M4A1-黑骑士"))
{
client_cmd(id, "tp_fov 57");
client_cmd(id, "tp_fe_r 193");
client_cmd(id, "tp_fe_g 0");
client_cmd(id, "tp_fe_b 0");
client_cmd(id, "tp_fe_a 150");
client_cmd(id, "tp_fe_x 80");
client_cmd(id, "tp_fe_y 120");
}else if(!strcmp(nowName, "MG3-炎魔"))
{
client_cmd(id, "tp_fov 45");
}else
{
client_cmd(id, "tp_fe_x 10000");
client_cmd(id, "tp_fe_y 10000");
}
}
return HAM_IGNORED;
}


public Secondary_Deploy(iEntity)
{
new id = pev(iEntity, pev_owner);
if(!pev_valid(iEntity))
{
return HAM_IGNORED;
}
if (is_user_alive(id) && !is_user_bot(id))
{
SuicGetPlayerWpnNow(id,nowWpn,nowName);
if(!strcmp(nowName, "万圣节毛瑟手枪"))
{
client_cmd(id, "tp_fov 67");
}else if(!strcmp(nowName, "沙漠之鹰"))
{
client_cmd(id, "tp_fov 41");
}else if(!strcmp(nowName, "沙鹰-天帝"))
{
client_cmd(id, "tp_fov 48");
client_cmd(id, "tp_fe_r 107");
client_cmd(id, "tp_fe_g 137");
client_cmd(id, "tp_fe_b 233");
client_cmd(id, "tp_fe_x 90");
client_cmd(id, "tp_fe_y 120");
}else if(!strcmp(nowName, "暗金沙鹰"))
{
client_cmd(id, "tp_fov 45");
}else if(!strcmp(nowName, "沙鹰-修罗"))
{
client_cmd(id, "tp_fov 85");
client_cmd(id, "tp_fe_r 255");
client_cmd(id, "tp_fe_g 0");
client_cmd(id, "tp_fe_b 0");
client_cmd(id, "tp_fe_x 80");
client_cmd(id, "tp_fe_y 105");
}
}
return HAM_IGNORED;
}


public Knife_Deploy(iEntity)
{
new id = pev(iEntity, pev_owner);
if(!pev_valid(iEntity))
{
return HAM_IGNORED;
}
if (is_user_alive(id) && !is_user_bot(id))
{
SuicGetPlayerWpnNow(id,nowWpn,nowName);
if(!strcmp(nowName, "龙啸"))
{
client_cmd(id, "tp_fov 57");
}else if(!strcmp(nowName, "军用铁锹"))
{
client_cmd(id, "tp_fov 45");
}else if(!strcmp(nowName, "军用手斧"))
{
client_cmd(id, "tp_fov 45");
}else if(!strcmp(nowName, "尼泊尔军刀"))
{
client_cmd(id, "tp_fov 45");
}else if(!strcmp(nowName, "屠龙"))
{
client_cmd(id, "tp_fov 48");
}else if(!strcmp(nowName, "KNIFE"))
{
client_cmd(id, "tp_fov 45");
}else if(!strcmp(nowName, "丛林匕首"))
{
client_cmd(id, "tp_fov 45");
}

}
return HAM_IGNORED;
}


public Grenade_Deploy(iEntity)
{
new id = pev(iEntity, pev_owner);
if(!pev_valid(iEntity))
{
return HAM_IGNORED;
}
if (is_user_alive(id) && !is_user_bot(id))
{
SuicGetPlayerWpnNow(id,nowWpn,nowName);
if(!strcmp(nowName, "HEGRENADE"))
{
client_cmd(id, "tp_fov 43");
}else if(!strcmp(nowName, "FLASH"))
{
client_cmd(id, "tp_fov 57");
}else if(!strcmp(nowName, "SMOKE"))
{
client_cmd(id, "tp_fov 57");
}
}
return HAM_IGNORED;


}


回复
1楼2017-01-19 17:17