10.01.2014, 10:45
I don't understand why you've switched to many cases. Why not like this?
The rest all seems good, but however, you could make this filterscript much more better.
• It'd also effect the players who are paused.
• It only reduces health, would improve more if it's like normal damages happening.
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
//As you've declared it from 0-100 :
new Float:damagingvar;
if(DAMAGE[playerid] <= 0) damagingvar = 0.0;
else if(DAMAGE[playerid] >= 100) damagingvar = 100.0;
else damagingvar = DAMAGE[playerid];
new Float:hp;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp-damagingvar);
return 1;
}
• It'd also effect the players who are paused.
• It only reduces health, would improve more if it's like normal damages happening.