Code:
decl MaxEntities, String:mName[64], Float:entPos[3];
MaxEntities = GetMaxEntities();
for(new i = 1; i <= MaxEntities; i++) {
if(IsValidEdict(i) && IsValidEntity(i)) {
GetEntPropString(i, Prop_Data, "m_ModelName", mName, sizeof(mName));
if(StrContains(mName, "infected") != -1) {
GetEntPropVector(i, Prop_Send, "m_vecOrigin", entPos);
entPos[2] += 50;
if(GetVectorDistance(trsPos[client], entPos) < radius) {
DamageEffect(i, 150.0 + (5.0 * medic_emfp[client]));
}
}
}
}
Code:
stock DamageEffect(target, Float:damage)
{
decl String:tName[20];
Format(tName, 20, "target%d", target);
new pointHurt = CreateEntityByName("point_hurt");
DispatchKeyValue(target, "targetname", tName);
DispatchKeyValueFloat(pointHurt, "Damage", damage);
DispatchKeyValue(pointHurt, "DamageTarget", tName);
DispatchKeyValue(pointHurt, "DamageType", "65536");
DispatchSpawn(pointHurt);
AcceptEntityInput(pointHurt, "Hurt");
AcceptEntityInput(pointHurt, "Kill");
}
Hello! my engilish really really.. bad..
i can give a damage/sec to common infected.
but i can not comfirm the CI dead.
Can not I get information(CI health or CI dead) about the CI from other function?
If you have to move to Event Infected Hurt, it will.