How do regenerating hp? -
Pokemon64 - 10.03.2017
Hi i need script that if you type command or what ever you can use it you get regenerating 5 hp for 3 seconds, if time over regenerating is stop.
Re: How do regenerating hp? -
Toroi - 10.03.2017
This is not the script requesting section, as far as I know.
You can make it yourself, get some errors and come back here asking for help on your errors. If you don't try you will never do it.
These following links can provide you all the help you need
https://sampwiki.blast.hk/wiki/Scripting_Basics
https://sampwiki.blast.hk/wiki/SetTimerEx
https://sampwiki.blast.hk/wiki/Control_Structures
Re: How do regenerating hp? -
henkas - 10.03.2017
Ok i tried and this stuff is not working fine. Hes not keep regenerating my health its just give +1hp and its stop. And i can still use regenerating if my hp is over 100 so easily i can bug my hp. Look
Код:
#define REGENTILL 15000 // Time tell when will the REGEN stop
#define REGENSTART 1000 // Time the regeneration will start
new regentimer;
new regen2timer;
new isRegenerating[MAX_PLAYERS];
forward regenerating(playerid);
forward regen2(playerid);
public regenerating(playerid)
{
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health+1);
isRegenerating[playerid] = 1;
regen2timer = SetTimer("regen2",REGENTILL, false);
return 1;
}
public regen2(playerid)
{
KillTimer(regentimer);
KillTimer(regen2timer);
isRegenerating[playerid] = 0;
}
CMD:test(playerid)
{
regentimer = SetTimer("regenerating", REGENSTART, false);
SendClientMessage(playerid,-1,"You are now regenerating HP");
return 1;
}
Re: How do regenerating hp? -
Toroi - 10.03.2017
Quote:
Originally Posted by Troydere
|
https://sampforum.blast.hk/showthread.php?tid=531009
Re: How do regenerating hp? -
Pokemon64 - 10.03.2017
So how should i fix these problems? "Hes not keep regenerating my health its just give +1hp and its stop. And i can still use regenerating if my hp is over 100 so easily i can bug my hp."
Re: How do regenerating hp? -
Toroi - 10.03.2017
Do you want to learn or do you want a fully working script to copy and paste in your gamemode?
Re: How do regenerating hp? -
Pokemon64 - 10.03.2017
Copy and paste.
Re: How do regenerating hp? -
Toroi - 10.03.2017
Quote:
Originally Posted by Pokemon64
Copy and paste.
|
Gotcha. Sorry, I can't help you.
Re: How do regenerating hp? -
Pokemon64 - 10.03.2017
How need end timer, i want make it work only for 5seconds if 5 seconds end, timer will killed and hp will not gained bat after couple second passed again i can use it
Код:
forward Regeneration(playerid, timess);
public Regeneration(playerid, timess)
{
new Float: Health;
if(GetPlayerHealth(playerid, Health))
{
if(100.0 < (Health += 2.0)) SetPlayerHealth(playerid, 100.0);
else
{
SetPlayerHealth(playerid, Health);
SetTimerEx("Regeneration", 2000, false, "dd", playerid, times - 1);
}
return true;
}
return false;
}
Re: How do regenerating hp? -
Pokemon64 - 10.03.2017
Up up up