Raised This Month: $ Target: $400
 0% 

Detect if user jumped


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 07-16-2011 , 09:23   Detect if user jumped
Reply With Quote #1

I want to detect if a user is jumped and store it in a variable.
smth like this.

PHP Code:
if (jump)
jumpcount++ 
Ive searched in forum and some .inc files but found nothing.
plowed is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-16-2011 , 09:36   Re: Detect if user jumped
Reply With Quote #2

PHP Code:
#include < hamsandwich >

RegisterHamHam_Player_Jump"player""Player_Jump" )

public 
Player_Jumpid )
{
    
// check if user alive
        
countid ]++

    
// ...

dFF is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-16-2011 , 09:47   Re: Detect if user jumped
Reply With Quote #3

Quote:
Originally Posted by dFF View Post
PHP Code:
#include < hamsandwich >

RegisterHamHam_Player_Jump"player""Player_Jump" )

public 
Player_Jumpid )
{
    
// check if user alive
        
countid ]++

    
// ...

Did you test your code?

Edit: Added check for if is on ground.

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

new const Version[] = "0.1";

new 
g_iJumpCount33 ];

public 
plugin_init() 
{
    
register_plugin"Jump Count" Version "bugsy" );
    
    
register_forwardFM_CmdStart "fw_FMCmdStart" );
    
register_clcmd"say /jumps" "CmdCheckJumps" );
}

public 
client_putinserverid )
{
    
g_iJumpCountid ] = 0;
}

public 
CmdCheckJumpsid )
{
    
client_printid print_chat "* You have jumped %d times!" g_iJumpCountid ] );
    return 
PLUGIN_HANDLED;
}

public 
fw_FMCmdStartid handle seed )
{
    if ( ( 
get_uchandle UC_Buttons ) & IN_JUMP ) && !( pevid pev_oldbuttons ) & IN_JUMP ) && ( pevid pev_flags ) & FL_ONGROUND ) )
        
g_iJumpCountid ]++;

__________________

Last edited by Bugsy; 07-17-2011 at 10:07.
Bugsy is offline
Stang
Junior Member
Join Date: Jul 2011
Location: Mustang
Old 07-16-2011 , 23:47   Re: Detect if user jumped
Reply With Quote #4

I tried your plugin bugsy, and I found a bug. After you jump for awhile itll start counting your jumps by 5's and 4's etc... then go back down to normal.
__________________
StANG
Stang is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-17-2011 , 00:05   Re: Detect if user jumped
Reply With Quote #5

You also need to check if player is on ground.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-17-2011 , 10:07   Re: Detect if user jumped
Reply With Quote #6

Fixed
__________________
Bugsy is offline
Rossonero
Senior Member
Join Date: Mar 2009
Location: Location
Old 03-15-2012 , 10:52   Re: Detect if user jumped
Reply With Quote #7

while thank you so much Bugsy & co.

I'm on the verge of creating a solution against bunny hop and flop and stuff
hopefully it will work
__________________
signature

Last edited by Rossonero; 03-15-2012 at 10:52.
Rossonero 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 00:48.


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