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

[TF2] Engineer Metal Regen


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Plugin ID:
1260
Plugin Version:
2.0.3
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    46 
    Plugin Description:
    Regenerates engineers build metal at a configurable rate.
    Old 10-31-2009 , 19:40   [TF2] Engineer Metal Regen
    Reply With Quote #1

    [TF2] Engineer Metal Regen
    Version 2.0.3



    Description:
    Regenerates engineers' build metal at a configurable rate.

    Commands:
    None
    Cvars:
    • sm_rmetal_version - Plugin Version
    • sm_rmetal_enable "1" - Set to 0 to disable the plugin
    • sm_rmetal_rate "5.0" - Time in seconds to wait between each tick.
    • sm_rmetal_size "5" - How much metal to add or subtract from players each tick.
    • sm_rmetal_max "200" - Max metal a player should have. (The plugin wont add metal if players are at the max).
    • sm_rmetal_adminonly "0" - Set to 1 and only players with the correct admin flag will get metal.
      You can use the override "rmetal_override" to set the required flag.
    Install Instructions:
    1. Place MetalRegen.smx in your sourcemod/plugins/ folder and load the plugin.

    Version History:
    • V1.0.0
      • Beta release
    • V1.5.0
      • Public (working) release
    • V1.5.1
      • Added check to prevent metal from exceeding 200.
    • V1.5.2
      • Fixed plugin not killing timers if a player is dead.
    • V2.0.0
      • Complete rewrite:
      • Code is now cleaner and more efficient
      • Perks and normal versions combined into one plugin
      • Extra cvars added
      • Players now all get metal at the same time, rather then each player having a personal timer.
    • V2.0.1
      • Fixed spawning extra timer instances.
    • V2.0.2
      • Fixed a couple typos
      • Changed to Get/SetEntProp
    • V2.0.3
      • Fixed incorrect cvar bounds

    Total downloads prior to 1/5/2012 : 2,653
    Attached Files
    File Type: sp Get Plugin or Get Source (MetalRegen.sp - 4615 views - 2.6 KB)
    __________________

    Last edited by DarthNinja; 08-11-2012 at 02:47.
    DarthNinja is offline
    noodleboy347
    AlliedModders Donor
    Join Date: Mar 2009
    Old 10-31-2009 , 19:43   Re: [TF2] Engineer Metal Regen
    Reply With Quote #2

    I like this idea. Like the Medic's health regen.
    noodleboy347 is offline
    Chris-_-
    SourceMod Donor
    Join Date: Oct 2008
    Old 10-31-2009 , 20:15   Re: [TF2] Engineer Metal Regen
    Reply With Quote #3

    You're passing the handles of your convars as parameters as if they were the actual values inside the convars. Use GetConVarInt for that purpose.
    Chris-_- is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 10-31-2009 , 22:17   Re: [TF2] Engineer Metal Regen
    Reply With Quote #4

    Quote:
    Originally Posted by noodleboy347 View Post
    I like this idea. Like the Medic's health regen.
    Exactly!
    I'm also planning on adding an optional admin flag for donators

    Quote:
    Originally Posted by Chris-_- View Post
    You're passing the handles of your convars as parameters as if they were the actual values inside the convars. Use GetConVarInt for that purpose.
    That would explain why with the latest version my metal goes to 1044

    -Edit,
    ...And testing!
    __________________

    Last edited by DarthNinja; 10-31-2009 at 22:39.
    DarthNinja is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 10-31-2009 , 23:02   Re: [TF2] Engineer Metal Regen
    Reply With Quote #5

    Got it working 100%
    Redoing post page
    __________________
    DarthNinja is offline
    Asgardcfr
    Junior Member
    Join Date: May 2009
    Old 11-01-2009 , 07:38   Re: [TF2] Engineer Metal Regen
    Reply With Quote #6

    I'm sorry, I learn more about tick rate in google but it's obscure for me

    tickrate "5" = 5 seconds and regen 5 metals ?

    Thanks for your help
    __________________
    Left4dead2 Server
    l4d1 server:91.121.64.184:27016 (Off CPU limited)
    l4d2 server:91.121.64.184:27015
    Asgardcfr is offline
    SilentLikeSilence
    Senior Member
    Join Date: Jul 2009
    Old 11-01-2009 , 10:01   Re: [TF2] Engineer Metal Regen
    Reply With Quote #7

    Quote:
    Originally Posted by Asgardcfr View Post
    I'm sorry, I learn more about tick rate in google but it's obscure for me

    tickrate "5" = 5 seconds and regen 5 metals ?

    Thanks for your help
    m_Rate = CreateConVar("sm_rmetal_rate", "5.0", "How fast in seconds to regen metal");

    example: sm_rmetal_rate "5.0"

    (it means 5 seconds) So your metal will be set to 200 after every 5 seconds.

    Silent

    Last edited by SilentLikeSilence; 11-01-2009 at 10:05.
    SilentLikeSilence is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 11-01-2009 , 14:22   Re: [TF2] Engineer Metal Regen
    Reply With Quote #8

    The first cvar sm_rmetal_rate sets the tick rate in seconds, so sm_rmetal_rate "5.0" would mean that the plugin 'ticks' every 5 seconds.

    sm_rmetal_size is the amount of metal the plugin adds to the engie's build metal.

    so for example size = 5 & rate = 5 then give the engi 5 metal every 5 seconds
    so again, 0sec = 100metal, 5 sec = 105 metal, 10 sec = 110 metal etc.

    the size and rate do not have to the the same obviously. You could if you wanted set it to regen 15 metal every five sec, or 17 metal every 11 sec.

    So, simple breakdown:
    sm_rmetal_rate controls the time it takes to regen metal.
    sm_rmetal_size controls now much metal to give every X seconds. (X seconds being controlled by the sm_rmetal_rate cvar)

    Quote:
    Originally Posted by SilentLikeSilence View Post
    (it means 5 seconds) So your metal will be set to 200 after every 5 seconds.

    Silent
    Actually it wont set the ammo directly to 200 unless you have the size cvar set to 200.
    __________________

    Last edited by DarthNinja; 11-01-2009 at 14:26.
    DarthNinja is offline
    SilentLikeSilence
    Senior Member
    Join Date: Jul 2009
    Old 11-09-2009 , 11:05   Re: [TF2] Engineer Metal Regen
    Reply With Quote #9

    Just noticed that the plugin doesn't kill any timer and creates one more timer everytime when engineer spawns.
    SilentLikeSilence is offline
    DarthNinja
    SourceMod Plugin Approver
    Join Date: Mar 2009
    Location: PreThinkHook()
    Old 11-09-2009 , 14:28   Re: [TF2] Engineer Metal Regen
    Reply With Quote #10

    Quote:
    Originally Posted by SilentLikeSilence View Post
    Just noticed that the plugin doesn't kill any timer and creates one more timer everytime when engineer spawns.
    Should be fixed now:
    • V1.5.2
      • Fixed plugin not killing timers if a player is dead.
    __________________
    DarthNinja 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 11:56.


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