AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Engineer Metal Regen (https://forums.alliedmods.net/showthread.php?t=107906)

DarthNinja 10-31-2009 19:40

[TF2] Engineer Metal Regen
 
1 Attachment(s)
[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

noodleboy347 10-31-2009 19:43

Re: [TF2] Engineer Metal Regen
 
I like this idea. Like the Medic's health regen.

Chris-_- 10-31-2009 20:15

Re: [TF2] Engineer Metal Regen
 
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.

DarthNinja 10-31-2009 22:17

Re: [TF2] Engineer Metal Regen
 
Quote:

Originally Posted by noodleboy347 (Post 977171)
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-_- (Post 977214)
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 :nono:

-Edit,
...And testing!

DarthNinja 10-31-2009 23:02

Re: [TF2] Engineer Metal Regen
 
Got it working 100% :up:
Redoing post page :o

Asgardcfr 11-01-2009 07:38

Re: [TF2] Engineer Metal Regen
 
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 :)

SilentLikeSilence 11-01-2009 10:01

Re: [TF2] Engineer Metal Regen
 
Quote:

Originally Posted by Asgardcfr (Post 977823)
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");

:arrow:example: sm_rmetal_rate "5.0"

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

Silent

DarthNinja 11-01-2009 14:22

Re: [TF2] Engineer Metal Regen
 
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 (Post 977885)
(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.

SilentLikeSilence 11-09-2009 11:05

Re: [TF2] Engineer Metal Regen
 
Just noticed that the plugin doesn't kill any timer and creates one more timer everytime when engineer spawns.

DarthNinja 11-09-2009 14:28

Re: [TF2] Engineer Metal Regen
 
Quote:

Originally Posted by SilentLikeSilence (Post 985014)
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.


All times are GMT -4. The time now is 08:39.

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