17.05.2012, 08:23
pawn Код:
new LoseHP[MAX_PLAYERS];
forward NegativeDown(playerid);
public OnPlayerUpdate(playerid) // not recommended but just for the test.
{
if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z))
{
LoseHP[playerid] = SetTimerEx("NegativeDown",1000,1,"i",playerid);
}
return 1;
}
public NegativeDown(playerid)
{
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health - 1.5); // Getting the players health and dropping it down by 1.5 hp (float)
return 1;
}
// Remember to use KillTimer(LoseHP[playerid]); Somewhere to stop losing health