AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any] Admin HP Regeneration (https://forums.alliedmods.net/showthread.php?t=236606)

joac1144 03-08-2014 09:21

[Any] Admin HP Regeneration
 
2 Attachment(s)
Description:
A little plugin to let admins with F/Slay flag regenerate their health.


This is only tested in Counter-Strike: Source.

CVAR list:
adminregen_version - Plugin version, do not change this.
adminregen_maxhp "100" - Maximum HP you can have after regenerating.
adminregen_health "2" - Amount of health to regenerate.
adminregen_time "2.0" - Time (in seconds) between each heal.
You can edit the values of every ConVar in cfg/sourcemod/plugin.adminregen.cfg.


Command list:
sm_adminregen - activates the regeneration


Changelog:
Quote:

03-08-2014 (v1.0)

*Plugin released

09-20-2015 (v1.1)

*Updated to new syntax
*A few small things are added

*09-25-2015 (v1.1.1)

*Checking if client is 0
Installation:
Download adminregen_sm_1.8.smx or adminregen_sm_1.6.smx and put it into your addons/sourcemod/plugins/ folder.

Peace-Maker 03-08-2014 09:50

Re: [Any] Admin HP Regeneration
 
Nice idea to extract that stuff into a simple plugin! Few things:
Don't close the timer handle in the timer callback! return Plugin_Stop if you want to stop the timer there!
I don't see the point of the second timer. You can check the maxhp in RegenTimer too.
You should check the client in RegenTimer against being 0 and return Plugin_Stop if that's the case. GetClientFromSerial returns 0 if the client disconnected in the meantime.
Also you should store the timer handle of the timer you create per admin in AdminRegenCmd and don't start another timer, if the admin already typed !adminregen and a timer is already running for him.

You can also check the rpg plugins how they do it.

shavit 03-08-2014 23:37

Re: [Any] Admin HP Regeneration
 
Hmmm

joac1144 03-09-2014 04:55

Re: [Any] Admin HP Regeneration
 
Quote:

Originally Posted by Peace-Maker (Post 2109124)
Nice idea to extract that stuff into a simple plugin!

Thanks

Quote:

Originally Posted by Peace-Maker (Post 2109124)
Few things:
Don't close the timer handle in the timer callback! return Plugin_Stop if you want to stop the timer there!
I don't see the point of the second timer. You can check the maxhp in RegenTimer too.
You should check the client in RegenTimer against being 0 and return Plugin_Stop if that's the case. GetClientFromSerial returns 0 if the client disconnected in the meantime.
Also you should store the timer handle of the timer you create per admin in AdminRegenCmd and don't start another timer, if the admin already typed !adminregen and a timer is already running for him

I will try that soon

joac1144 03-09-2014 05:00

Re: [Any] Admin HP Regeneration
 
Quote:

Originally Posted by shavit (Post 2109479)

That plugin isn't the same as mine; the other HP Regeneration plugins isn't activated by a command, which mine is.

asdfxD 12-27-2014 16:52

Re: [Any] Admin HP Regeneration
 
not working in cs:go :(

joac1144 09-20-2015 10:03

Re: [Any] Admin HP Regeneration
 
09-20-2015 (v1.1)

*Updated to new syntax
*A few small things are added

joac1144 09-25-2015 10:23

Re: [Any] Admin HP Regeneration
 
09-25-2015 (v1.1.1)

*Checking if client is 0.

joac1144 09-25-2015 10:46

Re: [Any] Admin HP Regeneration
 
Plugin also updated for SM 1.6.

phoenix0001 08-16-2022 07:00

Re: [Any] Admin HP Regeneration
 
Can anyone fix this plugin
Entering the sm_adminregen command once will increase 2HP, quickly entering it three times will double the HP(4) and so on


All times are GMT -4. The time now is 17:14.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.