05.04.2018, 09:05
Hey guys, i want to know, how to reduce player health every 5 seconds, not immediately. Because this is really annoying. I set -1 health in "OnPlayerUpdate" and it decreased 1 health every half-second.
Here is the codeКод:
public OnPlayerUpdate(playerid) { /* Many things that i'll not show in this code */ new status[64], Float:health, Float:armor, string[128]; GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armor); if(GetPVarInt(playerid, "Injured") != 1) { if(PlayerInfo[playerid][pTS] > 1 && health > 5) { SetPlayerHealth(playerid, health-1); } } if(GetPVarInt(playerid, "Injured") != 1) { if(PlayerInfo[playerid][pHS] > 1 && health > 5) { SetPlayerHealth(playerid, health-1); } } /* MANY MORE THINGS */ return 1; }