Raised This Month: $51 Target: $400
 12% 

[TF2] Building HP Regain


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Plugin ID:
2913
Plugin Version:
2.4.1
Plugin Category:
General Purpose
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Makes engineer buildings regain a set amount of hp overtime
    Old 04-18-2012 , 11:49   [TF2] Building HP Regain
    Reply With Quote #1

    Building HP Regain

    Description:
    Makes engineer buildings regain a set amount of hp overtime.
    Control Variables:
    • sm_bhp_enabled (default: 1) Time between building hp regenerations
    • sm_bhp_dispenser (default: 1) Amount of hp dispensers regenerate
    • sm_bhp_sentry (default: 1) Amount of hp sentrys regenerate
    • sm_bhp_teleporter (default: 1) Amount of hp teleporters regenerate
    Version Log:
    • Version 2.4.1
      • Added check so timer doesn't enable if plugin is disabled
    • Version 2.4
      • Reworked
    • Version 2.3
      • Added Enable/Disable convars for each building
      • Fixed handles
    • Version 2.2
      • Added Enable/Disable convar
    • Version 2.1
      • Fixed bugs
    • Version 2.0
      • Added support for all buildings instead of just dispensers
    • Version 1.1
      • Now properly kills timers
    • Version 1.0
      • Initial release
    My Plugins
    intox Gaming
    Attached Files
    File Type: sp Get Plugin or Get Source (buildinghpregain.sp - 1641 views - 2.9 KB)

    Last edited by ReFlexPoison; 07-19-2013 at 14:18. Reason: 2.4.1
    ReFlexPoison is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 04-18-2012 , 21:42   Re: [TF2] Dispenser HP Regain
    Reply With Quote #2

    *Reserved

    Last edited by ReFlexPoison; 05-12-2012 at 21:36.
    ReFlexPoison is offline
    NameUser
    Senior Member
    Join Date: Apr 2012
    Location: Bay Area, California
    Old 04-19-2012 , 21:14   Re: [TF2] Building HP Regain
    Reply With Quote #3

    This is extremely helpful on my tf2 server. Thank you for creating such a magnificent plugin.
    __________________
    NameUser is offline
    Send a message via Skype™ to NameUser
    Zephyrus
    Cool Pig B)
    Join Date: Jun 2010
    Location: Hungary
    Old 04-21-2012 , 15:43   Re: [TF2] Building HP Regain
    Reply With Quote #4

    for your information, as you use the same timer for all 3 buildings, the timers are irrelevant and just makes everything heal even faster, you should like a number in data to distuinguish which buildings to heal or something
    __________________
    Taking private C++/PHP/SourcePawn requests, PM me.
    Zephyrus is offline
    MasterOfTheXP
    Veteran Member
    Join Date: Aug 2011
    Location: Cloudbank
    Old 05-18-2012 , 01:41   Re: [TF2] Building HP Regain
    Reply With Quote #5

    Quote:
    Originally Posted by ReFlexPoison View Post
    * Removed plugin Enable/Disable CVar.
    It'd probably be better to just keep that in, so you can easily enable/disable all regeneration.
    __________________
    Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
    MasterOfTheXP is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 10-06-2012 , 19:16   Re: [TF2] Building HP Regain
    Reply With Quote #6

    PHP Code:
    public timersetCVarChanged(Handle:cvar, const String:oldVal[], const String:newVal[])
    {
        
    timerset GetConVarFloat(cvar);
        {
            
    ClearTimer(g_timer);
            {
                
    g_timer CreateTimer(timersetAddHealth_TIMER_REPEAT TIMER_FLAG_NO_MAPCHANGE);
            }
        }

    What's up with the random brackets?
    __________________
    Dr. McKay is offline
    11530
    Veteran Member
    Join Date: Sep 2011
    Location: Underworld
    Old 10-07-2012 , 00:15   Re: [TF2] Building HP Regain
    Reply With Quote #7

    I'm sure they were programming with you in mind, since you love brackets, hehehe. Always needs moar.
    __________________
    11530 is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 10-07-2012 , 02:17   Re: [TF2] Building HP Regain
    Reply With Quote #8

    Quote:
    Originally Posted by Dr. McKay View Post
    PHP Code:
    public timersetCVarChanged(Handle:cvar, const String:oldVal[], const String:newVal[])
    {
        
    timerset GetConVarFloat(cvar);
        {
            
    ClearTimer(g_timer);
            {
                
    g_timer CreateTimer(timersetAddHealth_TIMER_REPEAT TIMER_FLAG_NO_MAPCHANGE);
            }
        }

    What's up with the random brackets?
    Quote:
    Originally Posted by 11530 View Post
    I'm sure they were programming with you in mind, since you love brackets, hehehe. Always needs moar.
    This was an older plugin, hell, I don't even remember writing like this o.o

    I think I used to use brackets as if they forced something do to something after something <-- if that makes 'any' sense.

    I'll change it up tonight.

    Last edited by ReFlexPoison; 10-07-2012 at 03:01.
    ReFlexPoison is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 10-07-2012 , 09:25   Re: [TF2] Building HP Regain
    Reply With Quote #9

    It looks like setting the time cvar to 0 mid-map will make it start a timer with time 0.0 seconds. You might want to fix that.
    __________________
    Dr. McKay is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 10-07-2012 , 12:14   Re: [TF2] Building HP Regain
    Reply With Quote #10

    Quote:
    Originally Posted by Dr. McKay View Post
    It looks like setting the time cvar to 0 mid-map will make it start a timer with time 0.0 seconds. You might want to fix that.
    PHP Code:
    public CVarChange(Handle:convar, const String:oldVal[], const String:newVal[])
    {
        if(
    convar == VersionSetConVarString(VersionPLUGIN_VERSION);
        else if(
    convar == cvarEnabled)
        {
            
    ClearTimer(g_hTimer);
            if(
    GetConVarFloat(cvarEnabled) > 0.0g_hTimer CreateTimer(GetConVarFloat(cvarEnabled), AddHealth_TIMER_REPEAT TIMER_FLAG_NO_MAPCHANGE);
        }

    Added that, thanks for suggestions.
    ReFlexPoison is offline
    Reply



    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 23:59.


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