Hello guys, I got a problem with my code using SDK_HooksOnTakeDamage(),
What I want to do is to 1st set to all clients a lot of hp, after that, i use the above native to increase the damage received by players if they are low hp, but the thing which is interest me here is the pushback done by weapons which increase with the damage amount, so actually it works well along that, players received more and more damage and more and more pushback.
The problem come when the client is about to die, actually i dont want it to die, but just receive a big pushback:
Code:
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
if(damage > iHealth)
{
SetEntityHealth(victim, 10300);
damage = 10000;
damagetype &= ~DMG_PREVENT_PHYSICS_FORCE;
RequestFrame(clb, victim);
return Plugin_Changed;
}
}
void clb(client)
{
SetEntityHealth(client, 300);
}
Its set hp correctly but there isnt any pushback there, the client isnt pushed, can you help me? Or is there any other way to set pushback
__________________