Raised This Month: $7 Target: $400
 1% 

[ANY] Show Horizontal Speed (useful for bhop|surf) | Updated


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ChauffeR
Junior Member
Join Date: Dec 2013
Location: Italy
Plugin ID:
4050
Plugin Version:
1.1
Plugin Category:
Statistical
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    10 
    Plugin Description:
    Show player's horizontal speed with an overlay text
    Old 01-12-2014 , 18:39   [ANY] Show Horizontal Speed (useful for bhop|surf) | Updated
    Reply With Quote #1

    [ANY] Show Horizontal Speed (useful for bhop)
    This plugin shows the horizontal speed for every player through text on the screen.
    (Basically, the speed you see when you enable cl_showpos, except it will not calculate the vertical speed)

    It should work with any game as there is no mod-specific dependency.
    This can be useful on surf servers, bhopping, or similiar gamemodes.
    It has been tested on Team Fortress 2.



    Cvars
    • sm_hspeed_enabled * enables or disables the plugin
    • sm_hspeed_posx * Hud X position - default: -1 (center)
    • sm_hspeed_posy * Hud Y position - default: 0.89 (bottom)


    Screenshot:
    Spoiler
    Attached Files
    File Type: sp Get Plugin or Get Source (hspeed.sp - 9235 views - 1.9 KB)

    Last edited by ChauffeR; 05-09-2014 at 09:55. Reason: Plugin update
    ChauffeR is offline
    Snaggle
    AlliedModders Donor
    Join Date: Jul 2010
    Location: England
    Old 01-12-2014 , 19:38   Re: [ANY] Show Horizontal Speed
    Reply With Quote #2

    Cool I'll put this on my Surf one, thank you.
    Snaggle is offline
    Chdata
    Veteran Member
    Join Date: Aug 2012
    Location: Computer Chair, Illinois
    Old 01-13-2014 , 01:16   Re: [ANY] Show Horizontal Speed
    Reply With Quote #3

    Does it show horizontal speed, or will it actually show your cl_showpos velocity which can change and vary a lot if you jump or fall off a ledge (vertical speeds).

    Or does cl_showpos have an option to filter out the velocity from jumping?
    __________________

    Last edited by Chdata; 01-13-2014 at 01:16.
    Chdata is offline
    ChauffeR
    Junior Member
    Join Date: Dec 2013
    Location: Italy
    Old 01-13-2014 , 08:45   Re: [ANY] Show Horizontal Speed
    Reply With Quote #4

    It does show only horizontal speed, sorry, should've mentioned that where cl_showpos's speed changes with vertical movement, my plugin does not.
    ChauffeR is offline
    vodka00
    Veteran Member
    Join Date: Jun 2012
    Location: Los Angeles
    Old 03-16-2014 , 03:53   Re: [ANY] Show Horizontal Speed (useful for bhop)
    Reply With Quote #5

    L 02/13/2014 - 07:15:09: [SM] MEMORY LEAK DETECTED IN PLUGIN (file "custom\hspeed.smx") just something that I found in logs
    __________________
    cw main:

    cw speedruns:
    vodka00 is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 03-17-2014 , 10:06   Re: [ANY] Show Horizontal Speed (useful for bhop)
    Reply With Quote #6

    Quote:
    Originally Posted by vodka00 View Post
    L 02/13/2014 - 07:15:09: [SM] MEMORY LEAK DETECTED IN PLUGIN (file "custom\hspeed.smx") just something that I found in logs
    Heres a fix, it was due to the creation of timers, i believe. I just removed creating the individual timers, and just used one timer, that loops through all active players.
    Attached Files
    File Type: sp Get Plugin or Get Source (hspeed.sp - 1271 views - 1.8 KB)
    Mitchell is offline
    ChauffeR
    Junior Member
    Join Date: Dec 2013
    Location: Italy
    Old 05-09-2014 , 11:11   Re: [ANY] Show Horizontal Speed (useful for bhop)
    Reply With Quote #7

    Quote:
    Originally Posted by Mitchell View Post
    Heres a fix, it was due to the creation of timers, i believe. I just removed creating the individual timers, and just used one timer, that loops through all active players.
    Updated the plugin with your modifications, thanks.
    ChauffeR is offline
    TheTopMostDog
    Member
    Join Date: Jul 2012
    Location: Melbourne, Australia
    Old 02-08-2016 , 03:47   Re: [ANY] Show Horizontal Speed (useful for bhop|surf) | Updated
    Reply With Quote #8

    Any chance of getting a variation of this plugin with highscores (top speed last round displayed in chat, personal bests, top 10 highest speeds recorded on map/server)?

    Does anyone know of a speedometer which has stat retention like this?
    TheTopMostDog is offline
    dPexx
    New Member
    Join Date: Nov 2018
    Old 11-21-2018 , 11:04   Re: [ANY] Show Horizontal Speed (useful for bhop|surf) | Updated
    Reply With Quote #9

    Quote:
    Originally Posted by ChauffeR View Post
    [ANY] Show Horizontal Speed (useful for bhop)
    This plugin shows the horizontal speed for every player through text on the screen.
    (Basically, the speed you see when you enable cl_showpos, except it will not calculate the vertical speed)

    It should work with any game as there is no mod-specific dependency.
    This can be useful on surf servers, bhopping, or similiar gamemodes.
    It has been tested on Team Fortress 2.



    Cvars
    • sm_hspeed_enabled * enables or disables the plugin
    • sm_hspeed_posx * Hud X position - default: -1 (center)
    • sm_hspeed_posy * Hud Y position - default: 0.89 (bottom)


    Screenshot:
    Spoiler
    Hello thanks for your plugin, a little late but sadly when i use cl_drawhud 0 the speed goes away, and since i wanted to use this for surf videos that's not ideal, is it possible to modify this plugin so that it stays? cl_showpos 1 stays if drawhud is 0 so it should be possible, i think?
    dPexx is offline
    Ilusion9
    Veteran Member
    Join Date: Jun 2018
    Location: Romania
    Old 11-21-2018 , 13:23   Re: [ANY] Show Horizontal Speed (useful for bhop|surf) | Updated
    Reply With Quote #10

    new syntax
    PHP Code:
    #pragma semicolon 1 

    #include <sourcemod>

    ConVar g_Cvar_X;
    ConVar g_Cvar_Y;
    Handle g_Sync;

    public 
    Plugin myinfo 

        
    name "Show Horizontal Speed"
        
    author "ChauffeR"
        
    description "Show the horizontal speed of the player with a configurable HUD"
        
    version "1.1"
        
    url "http://hop.tf" 


    public 
    OnPluginStart()
    {    
        
    g_Cvar_X CreateConVar("sm_hspeed_posx""-1""X hud position | -1 = center");
        
    g_Cvar_Y CreateConVar("sm_hspeed_posy""0.89""Y hud position | -1 = center");
        
    AutoExecConfig();
        
        
    g_Sync CreateHudSynchronizer();
    }

    public 
    OnMapStart()
    {
        
    CreateTimer(0.2Timer_ShowSpeed_TIMER_REPEAT TIMER_FLAG_NO_MAPCHANGE);
    }

    public 
    Action Timer_ShowSpeed(Handle timerany data)
    {
        for (
    int i 1<= MaxClientsi++) // it's <= MaxClients, not <
        
    {
            if (
    IsClientInGame(i))
            {
                
    float velocity[3];
                
    GetEntPropVector(iProp_Data"m_vecVelocity"velocity);
                
    SetHudTextParams(g_Cvar_X.FloatValueg_Cvar_Y.FloatValue0.2255255255255);
                
                
    ClearSyncHud(ig_Sync);
                
    ShowSyncHudText(ig_Sync"%d"RoundToZero(SquareRoot(velocity[0] * velocity[0] + velocity[1] * velocity[1])));
            }
        }

    Ilusion9 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 07:00.


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