AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   Best way to make auto bunnyhop in module? (https://forums.alliedmods.net/showthread.php?t=214823)

11922911 04-30-2013 04:40

Best way to make auto bunnyhop in module?
 
My method is hooking PlayerPreThink, and setting player->velocity.z when press jump button/on ground or something...

Are there any other ways to make auto bunnyhop?:bacon!:

sry for my english

claudiuhks 04-30-2013 13:23

Re: Best way to make auto bunnyhop in module?
 
Hooking Player_Jump.

lazarev 04-30-2013 14:37

Re: Best way to make auto bunnyhop in module?
 
Quote:

Originally Posted by claudiuhks (Post 1943017)
Hooking Player_Duck.

are you freaking serious? :bacon:

11922911 04-30-2013 22:18

Re: Best way to make auto bunnyhop in module?
 
You mean... Player_Jump?

TheDS1337 05-01-2013 08:25

Re: Best way to make auto bunnyhop in module?
 
he means pEntity -> v.flag & IN_DUCK

claudiuhks 05-01-2013 14:12

Re: Best way to make auto bunnyhop in module?
 
Quote:

Originally Posted by lazarev (Post 1943090)
are you freaking serious? :bacon:

Sorry, what's wrong in there?

Quote:

Originally Posted by 11922911 (Post 1943397)
You mean... Player_Jump?

Player_Jump forward is executed on every player's frame while he is holding +jump button.

http://forums.alliedmods.net/showthr...am_Player_Jump

ConnorMcLeod 05-02-2013 02:20

Re: Best way to make auto bunnyhop in module?
 
on PM_Jump, remove IN_JUMP from pmove->oldbuttons

Jumps is proceeded in PM_JUMP, so this is correct place for you.
Jumps is made if player is on ground, and if oldbuttons don't contain IN_JUMP.

So, do what i told, and don't apply any velocity, jump gonna be made directly by the game.

see HLSDK multiplayer/pm_shared/pm_shared.c
Code:

void PM_Jump (void)
{
// [ ... ]
        if ( pmove->oldbuttons & IN_JUMP )
                return;                // don't pogo stick


You can also remove in PlayerPreThink IN_JUMP from pev->oldbuttons, because PM_* are executed after PreThink and pmove are copied from pev in there. Method gonna be easier to code but a bit less efficient, but in a module it seems ok.

11922911 05-02-2013 05:46

Re: Best way to make auto bunnyhop in module?
 
In your method (just remove IN_JUMP from oldbuttons)
Also be removed speed limit?

And i have no idea how to hook PM_Jump function, Could you give me some examples?

claudiuhks 05-02-2013 06:39

Re: Best way to make auto bunnyhop in module?
 
Connor says hooking PM_* functions are a bit less efficient. Instead of hooking Player_[Pre|Post]Think you could just hook Player_Jump to avoid so many checks.

11922911 05-02-2013 06:58

Re: Best way to make auto bunnyhop in module?
 
Oh sorry, I didn't read the post thoroughly..


All times are GMT -4. The time now is 19:38.

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