[TF2] Metal Calculator




Only real use is tf2 but i guess it should work for all..

A simple plugin that allows the users to solve simple math problems to find out the exact amount of metal they should pay or retrieve by calculating the exact Refine, Reclaim, and Scrap.

The idea was created when i found out people who are in my server trade a vast amount of items at a time and sometimes leave to go grab a calculator and or phone to help with there problems.


Put sm_metalcalc.smx into /addons/sourcemod/plugins and reboot your server or type "sm plugins load sm_metalcalc" into your console or rcon.


sm_count (See how it works for details)


!count <input float amount here Ex: 1.0> <Insert Metal Type: ref, rec, scrap or scraps(Caps don't matter)> <muliply amount here>

How it works?:

Simple! Let me show you a example:

!count 1.33 ref 2

This will come up as


[SMMC] Your total is: 2.66 ref or 8 rec or 24 scrap(s)

The layout of this is rather simple:


!count <input float amount here Ex: 1.0> <Insert Metal Type: ref, rec, scrap or scraps(Caps don't matter)> <muliply amount here>

More expressions will be added in future updates


List of metals references allowed by plugin.


ref refine refined | rec reclaim reclaimed | scrap scraps

The script is not case sensitive so don't worry about capitalizing anything!

Known problems:

Need to figure out how to round to the nearest whole number otherwise the users have to round up every once in a while in the sub category.



  • Float are now rounded to INTs for a better look appeal! (No more rounding up for sub values)

  • Added more commands


  • Fixed Colors showing up for ref values

  • Added Ceil Round for some floats (Still trying to round to whole number. You can see experiments in the source file)

  • added command sm_count

Side Note: Now i wasn't sure whether i should release this at all, i know its popular on my server but i don't know if there is a better version of this else where or not. I did do a search and came up with nothing so i thought why not!

This plugin isn't supposed to change the world! I know it could be written better and what not but i will be updating it soon with more features and better to look at code. Also if you guys have any ideas on some addon's or anything of the sort feel free to PM me about it, or just post it here.

There is also most likely a better way to write this but i am a beginner and im still learning so i will be updating this script as i move along.

Attached Files

File Type: sp

Get Plugin or
Get Source (sm_metalcalc.sp - 2.8 KB)

Orignal From: [TF2] Metal Calculator

No comments

Not a single link is allowed to submit in comment :o