Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Simple HP Regeneration by []Miller[]
- Like call of duty :D
- Version: 1b
- Fixed bugs*/
- #include <a_samp>
- new HPreg;
- forward HPregen(playerid);
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" blah blah blah by []Miller[]");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- //wanna add something?
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- HPreg = SetTimer("HPregen",1000,true); //Setting timer when player spawn
- SetPlayerHealth(playerid, 100); //let's set health to 100
- }
- public HPregen(playerid)
- {
- new Float:pHealth;
- GetPlayerHealth(playerid, pHealth);
- if(pHealth <= 100) SetPlayerHealth(playerid, pHealth+1); // regenerates +1 hp per 1,000 ms
- if(pHealth <= 20)
- {
- GameTextForPlayer(playerid,"~r~You're low in health, Find some cover before taking more damage!",3000,3); // announcing that you have low health while regenerating
- }
- if(pHealth == 100) KillTimer(HPreg); //Health is full!
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement