Raised This Month: $51 Target: $400
 12% 

[PAID][CSGO] Bhop horizontal speed limit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iShot
Member
Join Date: Jun 2010
Old 08-12-2015 , 11:42   [PAID][CSGO] Bhop horizontal speed limit
Reply With Quote #1

Dear,

I'm looking for a way to limit the horizontal speed for players to a certain amount.
I'm trying to integrate this to have a limited way of bhop on a jailbreak server on CSGO.
  • sv_enablebunnyhopping = 0: This doesn't work great since it completely destroys the bunny hopping and I only want to limit it.
  • sv_maxspeed = 400: This doesn't work either because it breaks the falling mechanic in the game since it also limits the vertical speed, this also breaks surfing

I would like something that limits your speed after a jump, this way surfing wouldn't be broken completely if a JB map integrates a surf minigame.

Best way to do it I think is like these plugins:
https://forums.alliedmods.net/showthread.php?p=1238747
https://forums.alliedmods.net/showthread.php?p=1260095



With kind regards,

iShot

Last edited by iShot; 08-12-2015 at 12:12.
iShot is offline
m_bNightstalker
Senior Member
Join Date: Jan 2015
Location: JWD
Old 08-12-2015 , 13:32   Re: [PAID][CSGO] Bhop horizontal speed limit
Reply With Quote #2

Where is my money now?

Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

public Plugin myinfo = 
{
    name = "Max Speed",
    author = "m_bNightstalker",
    description = "Limits horizontal player speed",
    version = "1.0",
    url = ""
};

public void OnPluginStart()
{
    HookEvent("player_jump", Event_PlayerJump);
}

public Action Event_PlayerJump(Handle event, const char[] name, bool dontBroadcast)
{
    int client = GetClientOfUserId(GetEventInt(event, "userid"));
    CreateTimer(0.0, CheckMaxSpeed, client);
}

public Action CheckMaxSpeed(Handle timer, any client)
{
    float fVelocity[3];
    GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
    float currentspeed = SquareRoot(Pow(fVelocity[0],2.0)+Pow(fVelocity[1],2.0));
    
    float maxspeed = 400.0;
    
    if (currentspeed > maxspeed)
    {
        float Multpl = currentspeed / maxspeed;
    
        if(Multpl != 0.0)
        {
            fVelocity[0] /= Multpl;
            fVelocity[1] /= Multpl;
            TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
        }
    }
}

Last edited by m_bNightstalker; 08-12-2015 at 13:38.
m_bNightstalker is offline
iShot
Member
Join Date: Jun 2010
Old 08-12-2015 , 15:30   Re: [PAID][CSGO] Bhop horizontal speed limit
Reply With Quote #3

Quote:
Originally Posted by m_bNightstalker View Post
Where is my money now?

Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

public Plugin myinfo = 
{
    name = "Max Speed",
    author = "m_bNightstalker",
    description = "Limits horizontal player speed",
    version = "1.0",
    url = ""
};

public void OnPluginStart()
{
    HookEvent("player_jump", Event_PlayerJump);
}

public Action Event_PlayerJump(Handle event, const char[] name, bool dontBroadcast)
{
    int client = GetClientOfUserId(GetEventInt(event, "userid"));
    CreateTimer(0.0, CheckMaxSpeed, client);
}

public Action CheckMaxSpeed(Handle timer, any client)
{
    float fVelocity[3];
    GetEntPropVector(client, Prop_Data, "m_vecVelocity", fVelocity);
    float currentspeed = SquareRoot(Pow(fVelocity[0],2.0)+Pow(fVelocity[1],2.0));
    
    float maxspeed = 400.0;
    
    if (currentspeed > maxspeed)
    {
        float Multpl = currentspeed / maxspeed;
    
        if(Multpl != 0.0)
        {
            fVelocity[0] /= Multpl;
            fVelocity[1] /= Multpl;
            TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fVelocity);
        }
    }
}
Dear,

You know what, it currently works like a charm and it saved a lot of problems on my end.
Send me your paypal in private and I'll happily transfer you a few beers!


With kind regards,

iShot
iShot is offline
Kxnrl
AlliedModders Donor
Join Date: May 2015
Old 10-13-2016 , 10:41   Re: [PAID][CSGO] Bhop horizontal speed limit
Reply With Quote #4

try this
Attached Files
File Type: sp Get Plugin or Get Source (bhopspeedlimiter.sp - 933 views - 1.7 KB)
File Type: sp Get Plugin or Get Source (bhopspeedlimiter_ze.sp - 390 views - 2.7 KB)
File Type: smx bhopspeedlimiter.smx (5.0 KB, 315 views)
File Type: smx bhopspeedlimiter_ze.smx (5.3 KB, 122 views)
__________________

Last edited by Kxnrl; 10-13-2016 at 10:58.
Kxnrl is offline
Reply



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 09:05.


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