#include < amxmodx >
#include < hamsandwich >
#include < reapi >
new const WEAPONENTNAMES[CSW_P90 + 1][] = {
"", "weapon_p228", "", "weapon_scout", "", "weapon_xm1014", "", "weapon_mac10",
"weapon_aug", "", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
"weapon_mp5navy", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
"weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "", "weapon_deagle", "weapon_sg552",
"weapon_ak47", "weapon_knife", "weapon_p90"
};
new g_eCvar[CSW_P90 + 1];
public plugin_init() {
g_eCvar[CSW_P228] = register_cvar("amx_dmg_p228","1.0");
g_eCvar[CSW_SCOUT] = register_cvar("amx_dmg_scout","1.0");
g_eCvar[CSW_XM1014] = register_cvar("amx_dmg_xm1014","1.0");
g_eCvar[CSW_MAC10] = register_cvar("amx_dmg_mac10","1.0");
g_eCvar[CSW_AUG] = register_cvar("amx_dmg_aug","1.0");
g_eCvar[CSW_ELITE] = register_cvar("amx_dmg_elite","1.0");
g_eCvar[CSW_FIVESEVEN] = register_cvar("amx_dmg_fiveseven","1.0");
g_eCvar[CSW_UMP45] = register_cvar("amx_dmg_ump45","1.0");
g_eCvar[CSW_SG550] = register_cvar("amx_dmg_sg550","1.0");
g_eCvar[CSW_GALIL] = register_cvar("amx_dmg_galil","1.0");
g_eCvar[CSW_FAMAS] = register_cvar("amx_dmg_famas","1.0");
g_eCvar[CSW_USP] = register_cvar("amx_dmg_usp","1.0");
g_eCvar[CSW_GLOCK18] = register_cvar("amx_dmg_glock18","1.0");
g_eCvar[CSW_AWP] = register_cvar("amx_dmg_awp","1.0");
g_eCvar[CSW_MP5NAVY] = register_cvar("amx_dmg_mp5navy","1.0");
g_eCvar[CSW_M249] = register_cvar("amx_dmg_m249","1.0");
g_eCvar[CSW_M3] = register_cvar("amx_dmg_m3","1.0");
g_eCvar[CSW_M4A1] = register_cvar("amx_dmg_m4a1","1.0");
g_eCvar[CSW_TMP] = register_cvar("amx_dmg_tmp","1.0");
g_eCvar[CSW_G3SG1] = register_cvar("amx_dmg_g3sg1","1.0");
g_eCvar[CSW_DEAGLE] = register_cvar("amx_dmg_deagle","1.0");
g_eCvar[CSW_SG552] = register_cvar("amx_dmg_sg552","1.0");
g_eCvar[CSW_AK47] = register_cvar("amx_dmg_ak47","1.0");
g_eCvar[CSW_KNIFE] = register_cvar("amx_dmg_knife","3.0");
g_eCvar[CSW_P90] = register_cvar("amx_dmg_p90","1.0");
for (new i = 1; i < sizeof WEAPONENTNAMES; i++)
if (WEAPONENTNAMES[i][0]) RegisterHam(Ham_Spawn, WEAPONENTNAMES[i], "Ham_CBasePlayerWeapon__Spawn_Post", true);
}
public Ham_CBasePlayerWeapon__Spawn_Post(const iWeapon) {
new iWeaponID = get_member(iWeapon, m_iId);
new Float:fDamage = get_pcvar_float(g_eCvar[iWeaponID]);
set_member(iWeapon, m_Weapon_flBaseDamage, Float:get_member(iWeapon, m_Weapon_flBaseDamage) * fDamage);
switch(iWeaponID) {
case CSW_M4A1: {
set_member(iWeapon, m_M4A1_flBaseDamageSil, Float:get_member(iWeapon, m_M4A1_flBaseDamageSil) * fDamage);
}
case CSW_USP: {
set_member(iWeapon, m_USP_flBaseDamageSil, Float:get_member(iWeapon, m_USP_flBaseDamageSil) * fDamage);
}
case CSW_FAMAS: {
set_member(iWeapon, m_Famas_flBaseDamageBurst, Float:get_member(iWeapon, m_Famas_flBaseDamageBurst) * fDamage);
}
case CSW_KNIFE: {
set_member(iWeapon, m_Knife_flStabBaseDamage, Float:get_member(iWeapon, m_Knife_flStabBaseDamage) * fDamage);
set_member(iWeapon, m_Knife_flSwingBaseDamage, Float:get_member(iWeapon, m_Knife_flSwingBaseDamage) * fDamage);
set_member(iWeapon, m_Knife_flSwingBaseDamage_Fast, Float:get_member(iWeapon, m_Knife_flSwingBaseDamage_Fast) * fDamage);
}
}
}