Raised This Month: $ Target: $400
 0% 

hook reload


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-06-2019 , 16:27   Re: hook reload
Reply With Quote #20

If you only care about the button press then this will work:
PHP Code:

#include <amxmodx>
#include <fakemeta>

public plugin_init() 
{
    
register_forwardFM_CmdStart "CmdStart" );
}

public 
CmdStartid uc_handle seed 
{
    static 
Buttons OldButtons;
    
    
Buttons get_ucuc_handle UC_Buttons );
    
OldButtons pevid pev_oldbuttons );
    
    if ( !( 
OldButtons IN_RELOAD ) && ( Buttons IN_RELOAD ) )
    {
        
//Reload pressed
    
}
    else if ( ( 
OldButtons IN_RELOAD ) && !( Buttons IN_RELOAD ) )
    {
        
//Reload released
    
}

__________________

Last edited by Bugsy; 01-06-2019 at 16:33.
Bugsy 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 13:49.


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