Raised This Month: $32 Target: $400
 8% 

Dispenser regain HP?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 04-14-2012 , 16:05   Dispenser regain HP?
Reply With Quote #1

Title says it - Curious on how I would do this. I would like to implement it into a future project. However, don't know how I would do so.
ReFlexPoison is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 04-14-2012 , 16:47   Re: Dispenser regain HP?
Reply With Quote #2

asked today, recently

https://forums.alliedmods.net/showthread.php?t=182832
__________________
View my Plugins | Donate
TnTSCS is offline
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 04-14-2012 , 16:56   Re: Dispenser regain HP?
Reply With Quote #3

Quote:
Originally Posted by TnTSCS View Post
Don't know how'd I use it for TF2, this is for CSS I'm assuming. =/

Really what I'm looking for is the dispenser to just regain a few hp every few seconds (changeable by CVar) which is probably what I'd implement.

Last edited by ReFlexPoison; 04-14-2012 at 16:57.
ReFlexPoison is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-16-2012 , 22:15   Re: Dispenser regain HP?
Reply With Quote #4

Quote:
Originally Posted by TnTSCS View Post
er... I assume you don't actually play TF2, as dispensers already heal nearby players of that team (and disguised enemy spies)... he wants the dispenser itself to heal.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Tylerst
Veteran Member
Join Date: Oct 2010
Old 04-16-2012 , 23:26   Re: Dispenser regain HP?
Reply With Quote #5

PHP Code:
new dispenser = -1
while ((
dispenser FindEntityByClassname(dispenser"obj_dispenser"))!=INVALID_ENT_REFERENCE)
{
    
SetVariantInt(healamount);
    
AcceptEntityInput(dispenser"AddHealth"); //Will not surpass maximum HP, so don't worry about adding health checks

If you want it to regenerate every x seconds, you would need to put it into a repeating timer.

Last edited by Tylerst; 04-16-2012 at 23:38.
Tylerst is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:13.


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