Posts: 811
Threads: 140
Joined: May 2013
Reputation:
0
Hello Every One I need Help How to Heal Player Slowly plz Help me
Posts: 166
Threads: 26
Joined: May 2013
Reputation:
0
Like every second one heal? Use timer...
Posts: 29
Threads: 0
Joined: Feb 2013
Reputation:
0
new HealTimer[MAX_PLAYERS];
new healCounter = -1;
HealTimer[playerid] = SetTimerEx("HealSlowly", time, true, "i", playerid); //add your favorite time, i think 500 is quite good
forward HealSlowly(playerid);
public HealSlowly(playerid){
if(healCounter == -1){
new health;
GetPlayerHealth(playerid, health);
healCounter = health;
}
healCounter++;
SetPlayerHealth(playerid, healCounter);
if(healCounter == MAX_VALUE){ //define your max_value if you want, otherwise use 100
KillTimer(HealTimer[playerid]);
}
}