Raised This Month: $ Target: $400
 0% 

How to catch holding fire button


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 09-07-2012 , 03:53   Re: How to catch holding fire button
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Ripped from CBasePlayer:reThink, should work.

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

#define m_afButtonLast 245

public plugin_init()
{
    
register_forward(FM_CmdStart"OnCmdStart"false)
}

public 
OnCmdStart(idcmd)
{
    static 
buttonsbuttonsChangedbuttonPressedbuttonReleased
    buttons 
get_uc(cmdUC_Buttons)

    
buttonsChanged get_pdata_int(idm_afButtonLast) ^ buttons

    buttonPressed 
buttonsChanged buttons
    buttonReleased 
buttonsChanged & ~buttons

    
if( buttonPressed IN_ATTACK )
    {
        
// just pressed +attack
    
}
    else if( 
buttonReleased IN_ATTACK )
    {
        
// just released +attack
    
}

Nice ConnorMcLeod, i love your coding

Last edited by 11922911; 09-07-2012 at 03:54.
11922911 is offline
 



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 08:20.


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