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

Bunny Hop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Repsol
Junior Member
Join Date: Jun 2020
Old 06-08-2020 , 04:04   Bunny Hop
Reply With Quote #1

I want the bunny hop plugin but with the feature I want

I want my speed not to slow down when I go back in bunny jump at high speed

video:

https://www.youtube.com/watch?v=9A_P...ature=youtu.be

I am currently using this plugin but it does not meet my requirements
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN    "Bhop Abilities"
#define VERSION "0.5.2"
#define AUTHOR    "ConnorMcLeod"

#define MAX_PLAYERS    32

#define OFFSET_CAN_LONGJUMP    356 // VEN
#define BUNNYJUMP_MAX_SPEED_FACTOR 1.7

#define PLAYER_JUMP        6

new g_iCdWaterJumpTime[MAX_PLAYERS+1]
new 
bool:g_bAlive[MAX_PLAYERS+1]
new 
bool:g_bAutoBhop[MAX_PLAYERS+1]

new 
g_pcvarBhopStyleg_pcvarAutoBhopg_pcvarFallDamage
new g_pcvarGravity

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_cvar("bhop_abilities"VERSIONFCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
    
g_pcvarBhopStyle register_cvar("bhop_style""2")  // (1 : no slowdown, 2 : no speed limit)
    
g_pcvarAutoBhop register_cvar("bhop_auto""1")
    
g_pcvarFallDamage register_cvar("mp_falldamage""1.0")

    
RegisterHam(Ham_Player_Jump"player""Player_Jump")
    
register_forward(FM_UpdateClientData"UpdateClientData")
    
register_forward(FM_CmdStart"CmdStart")
    
RegisterHam(Ham_Spawn"player""Check_Alive"1)
    
RegisterHam(Ham_Killed"player""Check_Alive"1)
    
RegisterHam(Ham_TakeDamage"player""Ham_TakeDamage_player")

    
register_concmd("amx_autobhop""AdminCmd_Bhop"ADMIN_LEVEL_A"<nick|#userid> <0|1>")

    
g_pcvarGravity get_cvar_pointer("sv_gravity")
}

public 
Check_Alive(id)
{
    
g_bAlive[id] = bool:is_user_alive(id)
}

public 
Ham_TakeDamage_player(identidattackerFloat:damagedamagebits)
{
    if( 
damagebits != DMG_FALL )
        return 
HAM_IGNORED

    damage 
*= get_pcvar_float(g_pcvarFallDamage)
    
SetHamParamFloat(4damage)

    return 
HAM_HANDLED
}

public 
CmdStart(iduc_handleseed)
{
    if(    
g_bAlive[id]
    &&    
get_pcvar_num(g_pcvarBhopStyle)
    &&    
get_uc(uc_handleUC_Buttons) & IN_USE
    
&&    pev(idpev_flags) & FL_ONGROUND    )
    {
        static 
Float:fVelocity[3]
        
pev(idpev_velocityfVelocity)
        
fVelocity[0] *= 0.3
        fVelocity
[1] *= 0.3
        fVelocity
[2] *= 0.3
        set_pev
(idpev_velocityfVelocity)
    }
}

public 
Player_Jump(id)
{
    if( !
g_bAlive[id] )
    {
        return
    }
    
    static 
iBhopStyle iBhopStyle get_pcvar_num(g_pcvarBhopStyle)
    if(!
iBhopStyle)
    {
        static 
iOldButtons iOldButtons pev(idpev_oldbuttons)
        if( (
get_pcvar_num(g_pcvarAutoBhop) || g_bAutoBhop[id]) && iOldButtons IN_JUMP && pev(idpev_flags) & FL_ONGROUND)
        {
            
iOldButtons &= ~IN_JUMP
            set_pev
(idpev_oldbuttonsiOldButtons)
            
set_pev(idpev_gaitsequencePLAYER_JUMP)
            
set_pev(idpev_frame0.0)
            return
        }
        return
    }

    if( 
g_iCdWaterJumpTime[id] )
    {
        
//client_print(id, print_center, "Water Jump !!!")
        
return
    }

    if( 
pev(idpev_waterlevel) >= )
    {
        return
    }

    static 
iFlags iFlags pev(idpev_flags)
    if( !(
iFlags FL_ONGROUND) )
    {
        return
    }

    static 
iOldButtons iOldButtons pev(idpev_oldbuttons)
    if( !
get_pcvar_num(g_pcvarAutoBhop) && !g_bAutoBhop[id] && iOldButtons IN_JUMP )
    {
        return
    }

    
// prevent the game from making the player jump
    // as supercede this forward just fails
    
set_pev(idpev_oldbuttonsiOldButtons IN_JUMP)

    static 
Float:fVelocity[3]
    
pev(idpev_velocityfVelocity)

    if(
iBhopStyle == 1)
    {
        static 
Float:fMaxScaledSpeed
        pev
(idpev_maxspeedfMaxScaledSpeed)
        if(
fMaxScaledSpeed 0.0)
        {
            
fMaxScaledSpeed *= BUNNYJUMP_MAX_SPEED_FACTOR
            
static Float:fSpeed
            fSpeed 
floatsqroot(fVelocity[0]*fVelocity[0] + fVelocity[1]*fVelocity[1] + fVelocity[2]*fVelocity[2])
            if(
fSpeed fMaxScaledSpeed)
            {
                static 
Float:fFraction
                fFraction 
= ( fMaxScaledSpeed fSpeed ) * 0.65
                fVelocity
[0] *= fFraction
                fVelocity
[1] *= fFraction
                fVelocity
[2] *= fFraction
            
}
        }
    }

    static 
Float:fFrameTimeFloat:fPlayerGravity
    global_get
(glb_frametimefFrameTime)
    
pev(idpev_gravityfPlayerGravity)

    new 
iLJ
    
if(    (pev(idpev_bInDuck) || iFlags FL_DUCKING)
    &&    
get_pdata_int(idOFFSET_CAN_LONGJUMP)
    &&    
pev(idpev_button) & IN_DUCK
    
&&    pev(idpev_flDuckTime)    )
    {
        static 
Float:fPunchAngle[3], Float:fForward[3]
        
pev(idpev_punchanglefPunchAngle)
        
fPunchAngle[0] = -5.0
        set_pev
(idpev_punchanglefPunchAngle)
        
global_get(glb_v_forwardfForward)

        
fVelocity[0] = fForward[0] * 560
        fVelocity
[1] = fForward[1] * 560
        fVelocity
[2] = 299.33259094191531084669989858532
        iLJ 
1
    
}
    else
    {
        
fVelocity[2] = 268.32815729997476356910084024775
    
}

    
fVelocity[2] -= fPlayerGravity fFrameTime 0.5 get_pcvar_num(g_pcvarGravity)

    
set_pev(idpev_velocityfVelocity)

    
set_pev(idpev_gaitsequencePLAYER_JUMP+iLJ)
    
set_pev(idpev_frame0.0)
}

public 
UpdateClientData(idsendweaponscd_handle)
{
    
g_iCdWaterJumpTime[id] = get_cd(cd_handleCD_WaterJumpTime)
}

public 
AdminCmd_Bhop(idlevelcid)
{
    if(!
cmd_access(idlevelcid2) )
    {
        return 
PLUGIN_HANDLED
    
}

    new 
szPlayer[32]
    
read_argv(1szPlayer31)
    new 
iPlayer cmd_target(idszPlayerCMDTARGET_OBEY_IMMUNITY CMDTARGET_ALLOW_SELF CMDTARGET_NO_BOTS)

    if( !
iPlayer )
    {
        return 
PLUGIN_HANDLED
    
}

    if( 
read_argc() < )
    {
        
g_bAutoBhop[iPlayer] = !g_bAutoBhop[iPlayer]
    }
    else
    {
        new 
arg2[2]
        
read_argv(2arg21)
        if(
arg2[0] == '1' && !g_bAutoBhop[iPlayer])
        {
            
g_bAutoBhop[iPlayer] = true
        
}
        else if(
arg2[0] == '0' && g_bAutoBhop[iPlayer])
        {
            
g_bAutoBhop[iPlayer] = false
        
}
    }

    
client_print(idprint_console"Player %s autobhop is currently : %s"szPlayerg_bAutoBhop[iPlayer] ? "On" "Off")
    return 
PLUGIN_HANDLED


Last edited by Repsol; 06-08-2020 at 04:07.
Repsol is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-08-2020 , 07:34   Re: Bunny Hop
Reply With Quote #2

g_pcvarBhopStyle = register_cvar("bhop_style", "2") // (1 : no slowdown, 2 : no speed limit)
__________________

Last edited by OciXCrom; 06-08-2020 at 07:34.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Repsol
Junior Member
Join Date: Jun 2020
Old 06-08-2020 , 07:42   Re: Bunny Hop
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
g_pcvarBhopStyle = register_cvar("bhop_style", "2") // (1 : no slowdown, 2 : no speed limit)
it did not work
Repsol is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-08-2020 , 10:12   Re: Bunny Hop
Reply With Quote #4

What did you do to change it?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Repsol
Junior Member
Join Date: Jun 2020
Old 06-08-2020 , 10:45   Re: Bunny Hop
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
What did you do to change it?
bhop_style 0 = no speed
bhop_style 1 = speed+
bhop_style 2 = speed++

That's how I felt about the changes,

Want to send a video of this?
Repsol is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-08-2020 , 13:38   Re: Bunny Hop
Reply With Quote #6

I don't know what you're trying to say. Set the cvar to "1" in amxx.cfg if you don't want the slowdown effect.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Repsol
Junior Member
Join Date: Jun 2020
Old 06-09-2020 , 03:58   Re: Bunny Hop
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
I don't know what you're trying to say. Set the cvar to "1" in amxx.cfg if you don't want the slowdown effect.
https://www.youtube.com/watch?v=soYc...ature=youtu.be

Please watch the video and see the result
Repsol is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-09-2020 , 07:30   Re: Bunny Hop
Reply With Quote #8

CVARs are changed via the server console, not the client console. Those things you wrote in your console did absolutely nothing. I already explained in my previous post what you should to in order to change the cvar.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Repsol
Junior Member
Join Date: Jun 2020
Old 06-09-2020 , 07:52   Re: Bunny Hop
Reply With Quote #9

Quote:
Originally Posted by OciXCrom View Post
CVARs are changed via the server console, not the client console. Those things you wrote in your console did absolutely nothing. I already explained in my previous post what you should to in order to change the cvar.
No, I was not on the server, In the video, I was offline counter strike,

The code worked on the console

Last edited by Repsol; 06-09-2020 at 07:53.
Repsol is offline
Repsol
Junior Member
Join Date: Jun 2020
Old 06-10-2020 , 07:22   Re: Bunny Hop
Reply With Quote #10

It's as if no one can help me :/
Repsol 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 16:56.


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