ADEPT
Пользователь
- Регистрация
- 2 Июл 2017
- Сообщения
- 130
- Симпатии
- 12
- Пол
- Мужской
Помогите в плагине сделать урон от HE 35 хп
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new P_Cvars[31]
public plugin_init()
{
register_plugin("Damage Control", "1.01", "Fxfighter")
RegisterHam(Ham_TakeDamage, "player", "hook_TakeDamage")
P_Cvars[0] = register_cvar("amx_dmg","1")
P_Cvars[1] = register_cvar("amx_dmg_p228","1.0")
P_Cvars[3] = register_cvar("amx_dmg_scout","1.0")
P_Cvars[4] = register_cvar("amx_dmg_grenade","1.0")
P_Cvars[5] = register_cvar("amx_dmg_xm1014","1.0")
P_Cvars[7] = register_cvar("amx_dmg_mac10","1.0")
P_Cvars[8] = register_cvar("amx_dmg_aug","1.0")
P_Cvars[10] = register_cvar("amx_dmg_elite","1.0")
P_Cvars[11] = register_cvar("amx_dmg_fiveseven","1.0")
P_Cvars[12] = register_cvar("amx_dmg_ump45","1.0")
P_Cvars[13] = register_cvar("amx_dmg_sg550","1.0")
P_Cvars[14] = register_cvar("amx_dmg_galil","1.0")
P_Cvars[15] = register_cvar("amx_dmg_famas","1.0")
P_Cvars[16] = register_cvar("amx_dmg_usp","1.0")
P_Cvars[17] = register_cvar("amx_dmg_glock18","1.0")
P_Cvars[18] = register_cvar("amx_dmg_awp","1.0")
P_Cvars[19] = register_cvar("amx_dmg_mp5navy","1.0")
P_Cvars[20] = register_cvar("amx_dmg_m249","1.0")
P_Cvars[21] = register_cvar("amx_dmg_m3","1.0")
P_Cvars[22] = register_cvar("amx_dmg_m4a1","1.0")
P_Cvars[23] = register_cvar("amx_dmg_tmp","1.0")
P_Cvars[24] = register_cvar("amx_dmg_g3sg1","1.0")
P_Cvars[26] = register_cvar("amx_dmg_deagle","1.0")
P_Cvars[27] = register_cvar("amx_dmg_sg552","1.0")
P_Cvars[28] = register_cvar("amx_dmg_ak47","1.0")
P_Cvars[29] = register_cvar("amx_dmg_knife","1.0")
P_Cvars[30] = register_cvar("amx_dmg_p90","1.0")
}
public hook_TakeDamage(Victim, Useless, Attacker, Float:damage, damagebits)
{
new Gun
if(Useless <= 30 && Useless != 0)
{
new dummy
Gun = get_user_weapon(Attacker,dummy,dummy)
}
else
{
new classname[32]
pev(Useless,pev_classname,classname,31)
if(equal(classname,"grenade"))
Gun = 4
}
new Floatmg = get_pcvar_float(P_Cvars[Gun])
if(get_pcvar_num(P_Cvars[0]) == 0 || Dmg == 1.0)
return HAM_IGNORED
SetHamParamFloat(4, damage*Dmg)
return HAM_HANDLED
}
#include <fakemeta>
#include <hamsandwich>
new P_Cvars[31]
public plugin_init()
{
register_plugin("Damage Control", "1.01", "Fxfighter")
RegisterHam(Ham_TakeDamage, "player", "hook_TakeDamage")
P_Cvars[0] = register_cvar("amx_dmg","1")
P_Cvars[1] = register_cvar("amx_dmg_p228","1.0")
P_Cvars[3] = register_cvar("amx_dmg_scout","1.0")
P_Cvars[4] = register_cvar("amx_dmg_grenade","1.0")
P_Cvars[5] = register_cvar("amx_dmg_xm1014","1.0")
P_Cvars[7] = register_cvar("amx_dmg_mac10","1.0")
P_Cvars[8] = register_cvar("amx_dmg_aug","1.0")
P_Cvars[10] = register_cvar("amx_dmg_elite","1.0")
P_Cvars[11] = register_cvar("amx_dmg_fiveseven","1.0")
P_Cvars[12] = register_cvar("amx_dmg_ump45","1.0")
P_Cvars[13] = register_cvar("amx_dmg_sg550","1.0")
P_Cvars[14] = register_cvar("amx_dmg_galil","1.0")
P_Cvars[15] = register_cvar("amx_dmg_famas","1.0")
P_Cvars[16] = register_cvar("amx_dmg_usp","1.0")
P_Cvars[17] = register_cvar("amx_dmg_glock18","1.0")
P_Cvars[18] = register_cvar("amx_dmg_awp","1.0")
P_Cvars[19] = register_cvar("amx_dmg_mp5navy","1.0")
P_Cvars[20] = register_cvar("amx_dmg_m249","1.0")
P_Cvars[21] = register_cvar("amx_dmg_m3","1.0")
P_Cvars[22] = register_cvar("amx_dmg_m4a1","1.0")
P_Cvars[23] = register_cvar("amx_dmg_tmp","1.0")
P_Cvars[24] = register_cvar("amx_dmg_g3sg1","1.0")
P_Cvars[26] = register_cvar("amx_dmg_deagle","1.0")
P_Cvars[27] = register_cvar("amx_dmg_sg552","1.0")
P_Cvars[28] = register_cvar("amx_dmg_ak47","1.0")
P_Cvars[29] = register_cvar("amx_dmg_knife","1.0")
P_Cvars[30] = register_cvar("amx_dmg_p90","1.0")
}
public hook_TakeDamage(Victim, Useless, Attacker, Float:damage, damagebits)
{
new Gun
if(Useless <= 30 && Useless != 0)
{
new dummy
Gun = get_user_weapon(Attacker,dummy,dummy)
}
else
{
new classname[32]
pev(Useless,pev_classname,classname,31)
if(equal(classname,"grenade"))
Gun = 4
}
new Floatmg = get_pcvar_float(P_Cvars[Gun])
if(get_pcvar_num(P_Cvars[0]) == 0 || Dmg == 1.0)
return HAM_IGNORED
SetHamParamFloat(4, damage*Dmg)
return HAM_HANDLED
}