19.10.2010, 00:05
Ok, I made this..
But.. how can I make if a player get's hurt(punched, fired, fall, etc) the HP goes down?
Thanks
pawn Код:
new Float: pHealth[MAX_PLAYERS];
SetTimer("CheckH", 1000, 1);
stock SetPlayerHealthEx(playerid, Float: health)
{
pHealth[playerid] = health;
SetPlayerHeatlh(playerid, health);
return 1;
}
stock GetPlayerHealthEx(playerid, &Float: health)
{
GetPlayerHealth(playerid, health);
return 1;
}
forward CheckH();
public CheckH()
{
static Float:old_health;
foreach(Player, i)
{
GetPlayerHealth(i, old_health);
if(old_health != pHealth[i])
{
SetPlayerHealthEx(i, pHealth[i]);
}
}
return 1;
}
Thanks