Quote:
Originally Posted by dFF
PHP Code:
#include < hamsandwich >
RegisterHam( Ham_Player_Jump, "player", "Player_Jump" )
public Player_Jump( id ) { // check if user alive count[ id ]++
// ... }
|
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_iJumpCount[ 33 ];
public plugin_init()
{
register_plugin( "Jump Count" , Version , "bugsy" );
register_forward( FM_CmdStart , "fw_FMCmdStart" );
register_clcmd( "say /jumps" , "CmdCheckJumps" );
}
public client_putinserver( id )
{
g_iJumpCount[ id ] = 0;
}
public CmdCheckJumps( id )
{
client_print( id , print_chat , "* You have jumped %d times!" , g_iJumpCount[ id ] );
return PLUGIN_HANDLED;
}
public fw_FMCmdStart( id , handle , seed )
{
if ( ( get_uc( handle , UC_Buttons ) & IN_JUMP ) && !( pev( id , pev_oldbuttons ) & IN_JUMP ) && ( pev( id , pev_flags ) & FL_ONGROUND ) )
g_iJumpCount[ id ]++;
}
__________________