[FilterScript] HP Regen by Gazmull 1.1b
#1

HP Regen 1.1b

INTRODUCTION
Hi guys i created new version of HP regen.
Since when i created the first one, it's buggy and only for one player(thanks for telling it Lorenc_)
But now i changed it, it works for all players!


How does this works?
If the player has 99 below hp, the script will regenerate +1 health per second for the player. This works for all players.

Compatibles?
It is compatible for TDMs, DMs, Free Roam or Server Owner's Decision :P

Changes
v1.0 - Regenerating for one player only.
v1.0b - Fixed bug, Regenerating for one player only.
v1.1a - Fixed almost of the bugs, Regenerating for all players.
v1.1b - Fixed and Final version, Regenerating for all players.


Rules
*It is forbidden to remove the copyright of the script.
*You can edit anything from it.
*I accept mirrors if you don't want to direct on my website


Credits
Lorenc_
Gazmull
SA-MP
And you for downloading it
Where's the link?
Get it here!
Click me
Reply
#2

Looks wrong still:
pawn Код:
forward HPreg(playerid);
public HPreg(playerid)
{
        for(new i = 0; i < MAX_PLAYERS; i ++)
        {
            if(IsPlayerConnected(i))
            {
                new Float:pHealth;
                GetPlayerHealth(i, pHealth);
                if(pHealth < 100) SetPlayerHealth(i, pHealth +1); // regenerates +1 hp per 1,000 ms
                if(pHealth < 30) GameTextForPlayer(i,"~r~Find some cover before taking more damage!",3000,3); // announcing that you have low health while regenerating
                        if(pHealth > 100)
                        {
                        SetPlayerHealth(i, 100); //Reset player health when health is full
                        }
                }
        }
}
the playerid parameter isn't used, I'd suggest removing the for loop if you're going to use settimerex... After that, yeah should be much better.
Reply
#3

Oh ok, well it's my nooby way i always use loop and thanks again for correcting me
Reply
#4

It look's good 8/10
Reply
#5

Thanks.
Reply
#6

could you give me the link, the link is broken
Reply
#7

new link please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)