Raised This Month: $ Target: $400
 0% 

Detect if user jumped


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-16-2011 , 09:36   Re: Detect if user jumped
Reply With Quote #1

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 #2

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
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