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

Make BunnyHop faster (In-game, not code)


Post New Thread Reply   
 
Thread Tools Display Modes
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
lazarev
Veteran Member
Join Date: Sep 2008
Old 07-11-2018 , 18:46   Re: Make BunnyHop faster (In-game, not code)
Reply With Quote #2

PHP Code:
new Float:velocity[3];
entity_get_vector(idEV_VEC_velocityvelocity);

new 
Float:dir[3];
xs_vec_copy(velocitydir);
dir[2] = 0.0;
xs_vec_normalize(dirdir);
xs_vec_mul_scalar(dir250.0dir);

xs_vec_add(velocitydirvelocity);
velocity[2] = 250.0
lazarev is offline
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 07-11-2018 , 19:56   Re: Make BunnyHop faster (In-game, not code)
Reply With Quote #3

Quote:
Originally Posted by lazarev View Post
PHP Code:
new Float:velocity[3];
entity_get_vector(idEV_VEC_velocityvelocity);

new 
Float:dir[3];
xs_vec_copy(velocitydir);
dir[2] = 0.0;
xs_vec_normalize(dirdir);
xs_vec_mul_scalar(dir250.0dir);

xs_vec_add(velocitydirvelocity);
velocity[2] = 250.0
So, i was missing a lot of things, huh?
Thanks, it is perfect.
__________________
marcelowzd is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 07-12-2018 , 11:52   Re: Make BunnyHop faster (In-game, not code)
Reply With Quote #4

@juice, is his code good alternative for using as axn for axn maps on kz servers? cuz admins are saying classical lan axn module can cause problems on online servers
JocAnis is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 07-12-2018 , 20:41   Re: Make BunnyHop faster (In-game, not code)
Reply With Quote #5

Quote:
Originally Posted by JocAnis View Post
@juice, is his code good alternative for using as axn for axn maps on kz servers? cuz admins are saying classical lan axn module can cause problems on online servers
What admins?

[edit] I don't want to go off-topic in this thread, can we discuss this through PM?

Last edited by lazarev; 07-12-2018 at 20:41.
lazarev is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 07-13-2018 , 11:40   Re: Make BunnyHop faster (In-game, not code)
Reply With Quote #6

yep, pm
JocAnis 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 22:07.


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