AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Make BunnyHop faster (In-game, not code) (https://forums.alliedmods.net/showthread.php?t=309049)

marcelowzd 07-11-2018 17:35

Make BunnyHop faster (In-game, not code)
 
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?

lazarev 07-11-2018 18:46

Re: Make BunnyHop faster (In-game, not code)
 
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


marcelowzd 07-11-2018 19:56

Re: Make BunnyHop faster (In-game, not code)
 
Quote:

Originally Posted by lazarev (Post 2603055)
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.

JocAnis 07-12-2018 11:52

Re: Make BunnyHop faster (In-game, not code)
 
@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

lazarev 07-12-2018 20:41

Re: Make BunnyHop faster (In-game, not code)
 
Quote:

Originally Posted by JocAnis (Post 2603153)
@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?

JocAnis 07-13-2018 11:40

Re: Make BunnyHop faster (In-game, not code)
 
yep, pm


All times are GMT -4. The time now is 11:47.

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