AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:S/?] Speedometer v1.0.6 (Updated: 8/27/12) (https://forums.alliedmods.net/showthread.php?t=141704)

thetwistedpanda 10-27-2010 17:49

[CS:S/?] Speedometer v1.0.6 (Updated: 8/27/12)
 
4 Attachment(s)
Description:
  • Provides functionality to print out a user's current speed, with the ability to derive real-world units or any unit you wish to display.
  • (Previously approved by asherkin; reapproved to update version cvar)
Features:
  • Provides functionality for printing out a user's current velocity into one of three separate areas: center area, hint area, or key hint area.
  • Provides optional functionality for determining who the fastest player is each round.
  • Provides clientpref functionality to save speedometer settings.
  • Commands sm_meter and sm_speedometer to toggle speedometer display.
  • Translation support.
  • Ability to derive real world values from in-game units, so you can actually see a player's MPH or FPS.
    • This plugin works under the assumption that a "hammer unit" is roughly an inch, so all conversions should be made under the assumption of inches per second.
  • Supports running during OnGameFrame, for the most precise results, or every 0.1 to 2.0 seconds per user configuration.
ConVars:
  • sm_speedometer_method: Determines plugin functionality. (-1 = OnGameFrame(), 0 = Disabled, 0.1 <-> 2.0 = Refresh Delay)
  • sm_speedometer_factor: Optional numerical value that can be used to derive real world units from in-game velocity. Default: \"0.0\"
  • sm_speedometer_area: Determines printing area functionality. (0 = Hint, 1 = Center, 2 = Hud Hint* (Note: May be CPU intensive))
  • sm_speedometer_fastest: If enabled, the player with the highest velocity will be displayed at the end of the round.
  • sm_speedometer_default: If enabled, new clients will start with the speedometer enabled.
Installation:
  • Place sm_speedometer.smx within /sourcemod/plugins/
  • Place sm_speedometer.phrases.txt within /sourcemod/translations/
Notice:
  • If you are experincing a "swish" noise with sm_speedometer_area set to 0, please ensure sv_hudhint_sound is set to 0 in your server configuration file.

GrO 10-28-2010 03:20

Re: [CS:S] Surfing Speedometer
 
Thanks for another useful/fun plugin.

Peace-Maker 10-28-2010 12:18

Re: [CS:S] Surfing Speedometer
 
Yours got more configuration options than this one, but i'd like to see the format cvar more dynamic like using {speed} as an replacer and allow using "Speed: {speed} mph" to add the unit.

thetwistedpanda 10-28-2010 12:28

Re: [CS:S] Surfing Speedometer
 
Hmm, that'll add a few more calls to the plugin which may reduce it's ability to be used in OnGameFrame, but I'll give it a shot.

thetwistedpanda 10-28-2010 12:53

Re: [CS:S] Surfing Speedometer
 
Version 1.0.1 Released! Anyone running the plugin prior will either have to delete their sm_surfing_meter.cfg and restart their server, or manually add the {SPEED} parameter to the sm_surfing_meter_format cvar. {SPEED} denotes where the velocity appears, and if you do not have it, no messages will be printed.

Xp3r7 10-29-2010 00:43

Re: [CS:S] Surfing Speedometer
 
I like the idea in that thread Peace-Maker linked to of displaying the the name of the fastest person on round end.

Would be another nice addition to this plugin!

Maybe in chat?

bobbobagan 10-29-2010 00:47

Re: [CS:S] Surfing Speedometer
 
Yeh I also like the idea above & being able to choose MPH or KM's since that is something more people can relate to.

Nice work on the plugin, I will use it on my surf server :D

In the original post it says Game: Counter-Strike: Source, however this could also be used on TF2 couldn't it? I don't see any specific CS:S code, nor did you include cstrike.inc file :P

thetwistedpanda 10-29-2010 01:01

Re: [CS:S] Surfing Speedometer
 
@ 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.

thetwistedpanda 10-29-2010 01:49

Re: [CS:S/TF2] Surfing Speedometer
 
Version 1.0.2 released! It changes the default plugin prefix to Speedometer, rather than Surfing, and adds the feature requested by Xp3r7. The cvar sm_surfing_meter_fastest will enable/disable the fastest player feature, and the cvar sm_surfing_meter_message will allow you to customize the message that is displayed based on your current settings.

Version 1.0.3 released! Fixed a small mistake in resetting the fastest variables, didn't take into consideration other units may be used.

Vycor 11-07-2010 04:09

Re: [CS:S/TF2] Surfing Speedometer
 
I seem to be having an issue. I'm using this for TF2 and while it seems to work fine when I enabled all the commands manually, when I add it to my server.cfg it doesnt seem to run the commands. I've tried putting it in the middle, at the end, etc... but nothings working. I even copy/pasted each line one by one into my console to verify everything was typed right, which it was... any ideas why its not working via server.cfg - I don't have much in there really... heres what I have:

Code:

sm_surfing_meter "-1"
sm_surfing_meter_factor 17.6
sm_surfing_meter_format "Speed: {SPEED} MPH"
sm_surfing_meter_area 1



All times are GMT -4. The time now is 15:29.

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