Код
stock DealDamage(victim, damage, attacker = -1, dmgflags = DMG_GENERIC, const String:weapon[] = "")
{
new String:strDmg[8], String:strDmgFlags[16];
IntToString(damage, strDmg, sizeof(strDmg));
IntToString(dmgflags, strDmgFlags, sizeof(strDmgFlags));
new hurtent = CreateEntityByName("point_hurt");
if(hurtent)
{
DispatchKeyValue(victim, "targetname", "dmgtarget");
DispatchKeyValue(hurtent, "DamageTarget", "dmgtarget");
DispatchKeyValue(hurtent, "Damage", strDmg);
DispatchKeyValue(hurtent, "DamageType", strDmgFlags);
if(weapon[0])
{
DispatchKeyValue(hurtent, "classname", weapon);
}
DispatchSpawn(hurtent);
AcceptEntityInput(hurtent, "Hurt", (attacker > 0) ? attacker : -1);
DispatchKeyValue(victim, "targetname", "nodmg");
// clean up
RemoveEdict(hurtent);
}
}
Добавлено (05.06.2014, 12:35:59)
---------------------------------------------
с плагина thc_rpg скилл Зеркальный урон
Добавлено (05.06.2014, 12:38:00)
---------------------------------------------
мож ещё посмотреть в API SDKHooks_TakeDamage