Raised This Month: $ Target: $400
 0% 

How to detect long jump jump?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 08-25-2010 , 16:06   How to detect long jump jump?
Reply With Quote #1

Like in the title. Player has long jump module and he uses long jump. How to detect this ?
__________________
Voi is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-25-2010 , 16:12   Re: How to detect long jump jump?
Reply With Quote #2

Hook CBasePlayer::SetAnimation(), and check if the param anim is equal to 5 ( PLAYER_SUPERJUMP ).

If you don't like orpheu, check if m_fLongJump > 0 + pev_button & IN_DUCK + pev_flDuckTime > 0 + length of pev_velocity > 50
__________________

Last edited by Arkshine; 08-25-2010 at 16:16.
Arkshine is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 08-31-2010 , 16:40   Re: How to detect long jump jump?
Reply With Quote #3

Thanks.

Not that i dont like orpheu. I just don't understand it. I'm not a programmer .
__________________
Voi is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-18-2016 , 18:58   Re: How to detect long jump jump?
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
Hook CBasePlayer::SetAnimation(), and check if the param anim is equal to 5 ( PLAYER_SUPERJUMP ).

If you don't like orpheu, check if m_fLongJump > 0 + pev_button & IN_DUCK + pev_flDuckTime > 0 + length of pev_velocity > 50
Sorry for bumping this topic, but I have the same question.

Currently I'm trying to use the second method (trying because I don't really know how to PAWN)

I don't know if I'm doing it right.

Code:
if(fm_get_user_longjump(plr) && (IN_DUCK + pev_flDuckTime > 0 + vector_length(vVel) > 50))
    {
            //some code

    }
It works only if I sightly press forward and then jump.

I'm also using fm_get_user_longjump because that portion of code activates even if the user doesn't have the item.

I don't use Orpheu because I don't really know how to hook variables.

Thanks in advance.
__________________
gabuch2 is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-25-2016 , 13:20   Re: How to detect long jump jump?
Reply With Quote #5

01/25/2016 bump
__________________
gabuch2 is offline
abood alnjjar
Member
Join Date: Oct 2015
Location: palestine
Old 01-25-2016 , 14:01   Re: How to detect long jump jump?
Reply With Quote #6

go to zombieplague.cfg Search to "leap" make zp_leap_zombie 0
__________________
abood alnjjar is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 01-29-2016 , 07:07   Re: How to detect long jump jump?
Reply With Quote #7

Quote:
Originally Posted by abood alnjjar View Post
go to zombieplague.cfg Search to "leap" make zp_leap_zombie 0
What?
__________________
gabuch2 is offline
abood alnjjar
Member
Join Date: Oct 2015
Location: palestine
Old 01-29-2016 , 08:11   Re: How to detect long jump jump?
Reply With Quote #8

Quote:
Originally Posted by Shattered Heart Lynx View Post
What?
(in mod zp 5.0
__________________
abood alnjjar is offline
SpannerSpammer
Member
Join Date: Mar 2006
Old 01-30-2016 , 01:15   Re: How to detect long jump jump?
Reply With Quote #9

Quote:
Originally Posted by Shattered Heart Lynx View Post
Code:
IN_DUCK + pev_flDuckTime > 0
That's why your code is being triggered all the time, you didn't use any code to check if the player
pressed any buttons. If pev_flDuckTime is non-zero then that statement will always be true.
You also need to check if the player is using the forward key AND the duck key to replicate the
Longjump code functionality:
Code:
new buttons;
buttons = get_user_button(plr);
if (fm_get_user_longjump(plr) && (buttons & IN_FORWARD) && (buttons & IN_DUCK) &&  ...
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf
SpannerSpammer is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 02-01-2016 , 07:14   Re: How to detect long jump jump?
Reply With Quote #10

Quote:
Originally Posted by SpannerSpammer View Post
That's why your code is being triggered all the time, you didn't use any code to check if the player
pressed any buttons. If pev_flDuckTime is non-zero then that statement will always be true.
You also need to check if the player is using the forward key AND the duck key to replicate the
Longjump code functionality:
Code:
new buttons;
buttons = get_user_button(plr);
if (fm_get_user_longjump(plr) && (buttons & IN_FORWARD) && (buttons & IN_DUCK) &&  ...
It works! Thanks!

I also had to put vector_length(vVel) > 125 in the condition, or else it would trigger when jumping while crawling. It comes with some minor bugs tho, like not triggering if the user longsjumps and his speed is too slow, but that does not matter.
__________________
gabuch2 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 10:10.


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