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

hold duck + jump = high jump


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-17-2008 , 11:53   hold duck + jump = high jump
Reply With Quote #1

Hello again, I'ved got into a bump... again

I tried to hook +jump to a simple public that detects if the user is ducking and make him jump higher... but I can't make the command run if I remove the ON_GROUND check using client prethink and press jump in air I'll fly =) and that's not what I need...

Anyways, the main thing is: When a player is pressing the jump button, detect if he's holding the duck button and do an action.
Can anyone help me ?
__________________

Last edited by Hunter-Digital; 01-17-2008 at 12:00.
Hunter-Digital is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-17-2008 , 12:13   Re: hold duck + jump = high jump
Reply With Quote #2

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

// make sure u leave the '.0' at the end of the number
// or you will get compile errors :)
#define HIGH_JUMP_SPEED 300.0

new bool:g_HighJump[32];

public 
plugin_init()
{
    
register_plugin("High Jump""1.0""Hunter-Digital");
    
register_forward(FM_PlayerPreThink"fwd_PlayerPreThink");
    
register_forward(FM_PlayerPostThink"fwd_PlayerPostThink");
}

public 
fwd_PlayerPreThink(id)
{
    if(
is_user_alive(id) && (pev(idpev_flags) & FL_ONGROUND))
    {
        static 
buttonoldbuttons;
        
button pev(idpev_button);
        
oldbuttons pev(idpev_oldbuttons);
        
        if((
oldbuttons IN_DUCK || button IN_DUCK) && (button IN_JUMP))
            
g_HighJump[id-1] = true;
        else
            
g_HighJump[id-1] = false;
    }
    return 
FMRES_IGNORED;
}

public 
fwd_PlayerPostThink(id)
{
    if(
is_user_alive(id) && g_HighJump[id-1])
    {
        static 
Float:velocity[3];
        
pev(idpev_velocityvelocity);
        
velocity[2] = HIGH_JUMP_SPEED;
        
set_pev(idpev_velocityvelocity);
        
g_HighJump[id-1] = false;
    }
    return 
FMRES_IGNORED;

you might have to play around with the number to get it the way u want it
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 01-17-2008, 15:55
hlstriker
This message has been deleted by hlstriker. Reason: misread the code sorry
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-17-2008 , 17:57   Re: hold duck + jump = high jump
Reply With Quote #3

What?
This is like a jump just a bit more powerfull.
[ --<-@ ] Black Rose is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-17-2008 , 18:48   Re: hold duck + jump = high jump
Reply With Quote #4

it checks if they are on the ground

and then they can only get the boost if they are on the ground and holding duck + jump

so they wont keep flying up into the air
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-17-2008 , 19:31   Re: hold duck + jump = high jump
Reply With Quote #5

yes, it works excelent, thak you +k

bdw, I just needed a little script, I do not intend to make a plugin just from this this was a bump , but's solved now

PS: bdw, this type of plugin has been already made ? high-jump by duck+jump ? 'cause you can release it X-olent in your name 'cause it's your work
__________________

Last edited by Hunter-Digital; 01-17-2008 at 19:38.
Hunter-Digital is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-18-2008 , 07:22   Re: hold duck + jump = high jump
Reply With Quote #6

i probably wont because its just a small plugin but i might
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-18-2008 , 12:04   Re: hold duck + jump = high jump
Reply With Quote #7

A small plugin that severily affects gameplay on a normal server
__________________
Hunter-Digital is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 01-24-2008 , 11:25   Re: hold duck + jump = high jump
Reply With Quote #8

how to know if player just jumped ?:F
__________________
Voi is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-24-2008 , 12:28   Re: hold duck + jump = high jump
Reply With Quote #9

as in he landed or he just left the ground?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
StSatan
Senior Member
Join Date: Apr 2010
Old 03-08-2011 , 09:58   Re: hold duck + jump = high jump
Reply With Quote #10

Exolent[jNr] Server fps is very low with this plugin. It cause much lags. Please fix it.
StSatan 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 11:50.


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