Raised This Month: $ Target: $400
 0% 

Make BunnyHop faster (In-game, not code)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 07-11-2018 , 17:35   Make BunnyHop faster (In-game, not code)
Reply With Quote #1

Hello guys, i'm trying to make the old bunnyhop enabler make the player go faster than it does currently.

PHP Code:
#include <amxmodx>
#include <engine>

#define    FL_WATERJUMP    (1<<11)    // player jumping out of water
#define    FL_ONGROUND    (1<<9)    // At rest / on the ground

public plugin_init()
{
    
register_plugin("Super Bunny Hopper""1.2""Cheesy Peteza")
}

public 
client_PreThink(id
{
    
entity_set_float(idEV_FL_fuser20.0);

    if (
entity_get_int(idEV_INT_button) & 2
    {
        new 
flags entity_get_int(idEV_INT_flags);

        if (
flags FL_WATERJUMP)
            return 
PLUGIN_CONTINUE;
            
        if (
entity_get_int(idEV_INT_waterlevel) >= 2)
            return 
PLUGIN_CONTINUE;
            
        if (!(
flags FL_ONGROUND))
            return 
PLUGIN_CONTINUE;

        new 
Float:velocity[3];
        
        
entity_get_vector(idEV_VEC_velocityvelocity);
        
velocity[2] += 250.0;

                
/* I wrote this - This kind of works, but sometimes it just throws the player to one side or another
        if( velocity[ 1 ] > velocity[ 0 ] )
            velocity[ 1 ] += ( velocity[ 1 ] > 0 ? 500 : -500 )
        else
            velocity[ 0 ] += ( velocity[ 0 ] > 0 ? 500 : -500 )
                */

        
new Float:fVelocity vector_lengthvelocity ); // This is the formula according to this https://forums.alliedmods.net/showthread.php?t=91474
        //new fSpeed = floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0)) // This is the code used in KZ Plugins

        
console_printid"%f"fVelocity ); // Just debug to know at what speed i'm

        // VelocityByAim doesn't do what i need
        
        
entity_set_vector(idEV_VEC_velocityvelocity);

        
entity_set_int(idEV_INT_gaitsequence6);
    }
    
    return 
PLUGIN_CONTINUE;

I want to make it give speed faster. What i wrote does that, but sometimes it just throws the player to one side or another. I don't understand
angles and such things in half-life so i'm pretty sure i'm doing things wrong. I tried VelocityByAim which gives velocity, but the player can't jump after the first jump anymore. What am i missing?
__________________

Last edited by marcelowzd; 07-11-2018 at 17:50.
marcelowzd is offline
 


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 12:33.


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