PHP Code:
if(!IsFakeClient(attacker) && !StrEqual(WeaponUsed,"Damge_Add"))
{
new Float:AddDamage = dmg*Str[attacker]*Effect_Str;
DealDamage(victim, AddDamage, attacker, dmgtype, "Damge_Add");
}
DealDamage(victim,Float:damage,attacker=0,dmg_type=0,String:weapon[]="")
{
if(IsValidEdict(victim) && damage>0)
{
new String:dmg_str[16];
FloatToString(damage,dmg_str,16);
new String:dmg_type_str[32];
IntToString(dmg_type,dmg_type_str,32);
new PointHurt = CreateEntityByName("point_hurt");
if(PointHurt)
{
DispatchKeyValue(victim,"targetname","dmged_target");
DispatchKeyValue(PointHurt,"DamageTarget","dmged_target");
DispatchKeyValue(PointHurt,"Damage",dmg_str);
DispatchKeyValue(PointHurt,"DamageType",dmg_type_str);
if(!StrEqual(weapon,""))
{
DispatchKeyValue(PointHurt,"classname",weapon);
}
DispatchSpawn(PointHurt);
AcceptEntityInput(PointHurt,"Hurt",(attacker>0)?attacker:-1);
DispatchKeyValue(PointHurt,"classname","point_hurt");
DispatchKeyValue(victim,"targetname","nondmged_target");
RemoveEdict(PointHurt);
}
}
}
I was using the above code to stimulate that player can add damage to the victim based on their str[attacker] and Effect_str, but this method will create one more hit. Can i just modified the player hurt event without adding one more hit.
P.S: I still want hurt/dead message created! (That's why i use the DealDamage() function)