View Single Post
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 10-29-2010 , 01:01   Re: [CS:S] Surfing Speedometer
Reply With Quote #8

@ Xp3r7, I'm fairly certain that would be incredibly easy to implement. Simply put, all it would require is a check in the display feature to see if the current user's velocity is higher than the last recorded velocity, and if so, store it. I don't think the performance impact would be anything to worry about since Surf servers generally don't have a lot going on.

@ bobbobagan, this plugin already supports the needed methodology required to display MPH or KM; you will, however, need to do a little math. It's safe to assume that a hammer unit is roughly an inch, so you can simply do a conversion from inches per second, to miles per hour or kilometers per hour. It won't be 100% accurate, but you probably won't get much better. Excuse the math lesson, but this may be useful for anyone wanting to figure out what needs to be done.

There are 12 inches per foot, and 5280 feet per mile, so that's (12 * 5280) inches per mile. Since there are 3600 seconds in an hour, you come up with the following formula: 1mph = (12 * 5280) / 3600. That works out to 17.6 inches per second. Likewise, there are (12 * 3280) feet per kilometer, so you end up with a value of 1 kmh = 10.93 inches per second. So, with that information, you can do the following:
PHP Code:
sm_surfing_meter_factor "17.6" //MPH
//sm_surfing_meter_factor "10.93" //KMH
sm_surfing_meter_format "Speed: {SPEED} MPH"
//sm_surfing_meter_format "Speed: {SPEED} KMH" 

At least, I believe that's right. I'm a little to drunk to be messing with numbers. I can't run TF2 on this crap computer so I don't know if it'll work, but the only requirement is clientprefs iirc.
__________________

Last edited by thetwistedpanda; 10-29-2010 at 02:06.
thetwistedpanda is offline