07.03.2013, 21:37
I'm trying to make "Talents" into my script, and one talent is Regeneration. I've made this code, but it doesn't seem to work. I want the player (Assuming they have the regeneration talent.) to regenerate 20 health every 15 seconds.
What's wrong with the code?
What's wrong with the code?
pawn Код:
forward Regeneration(playerid);
public Regeneration(playerid)
{
new Float:Health;
GetPlayerHealth(playerid, Health);
if(Health < 100)
{
SetPlayerHealth(playerid, Health+20);
}
}
//This is under OnPlayerSpawn.
if(PlayerInfo[playerid][pTalent] == 2)
{
SendClientMessage(playerid,COLOR_GREEN, "(Regeneration Talent): You now regenerate 20 health every 15 seconds.");
SetTimerEx("Regeneration", 15000, true, "%i", playerid);
}