Quote:
Originally Posted by siriusmd99
But damage shall be the same type as attacker , if it's float then you convert it to number :
damage = floatround(damage)
And then if you need damage as float, you just convert it back to float :
new Float:dmg = float(param[1])
|
You don't have to convert it, it's okay just to re-tag the variable to avoid the compiler warning. Doing it your way you are even truncating the fractional part of a float value, which is a data loss.
PHP Code:
public Player_TakeDamage(id, inflictor, attacker, Float: damage, damagetype) {
new params[2];
params[0] = attacker;
params[1] = _:damage;
set_task(0.2, "create_task", id + TASK_DAMAGE, params, sizeof(params), _, _, "b");
}
public create_task(params[], taskid) {
new attacker = params[0];
new Float: damage = Float: params[1];
}
I know it seems unnatural, and that tags in Pawn can be confusing. That's why we all hate tags.