23.07.2012, 16:03
I made a code, to make damages more realistic:
Is the command bugged or I just have to make the damage made lower? Currently if I shoot with a M4, I almost shoot the guy dead. The code is supposed to remove the amount of damage done from the player, and it returns 1 so it removes the amount of damage again. Is it X2 or bugged?
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
new Float:HP, Float: damage;
GetPlayerHealth(playerid, HP);
damage = floatdiv(HP, amount);
SetPlayerHealth(playerid, damage);
}
return 1;
}