Raised This Month: $12 Target: $400
 3% 

Player is holding a button


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DavidLin
Member
Join Date: Jan 2016
Old 01-12-2016 , 04:47   Player is holding a button
Reply With Quote #1

Hello,

How can I detect if player is holding a button in FM_CmdStart and detect when he releases it ?
DavidLin is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-12-2016 , 05:03   Re: Player is holding a button
Reply With Quote #2

If you want to bind keys is considered slowhacking is not supported here.

Last edited by raizo11; 01-12-2016 at 05:07.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Baws
Veteran Member
Join Date: Oct 2012
Old 01-12-2016 , 05:10   Re: Player is holding a button
Reply With Quote #3

Quote:
Originally Posted by raizo11 View Post
If you want to bind keys is considered slowhacking is not supported here.
True, but maybe he wants to do something other than that.
__________________
Like my clean plugins and work?
Baws is offline
DavidLin
Member
Join Date: Jan 2016
Old 01-12-2016 , 05:32   Re: Player is holding a button
Reply With Quote #4

Fixed it, needed to get oldbuttons.

PHP Code:
public CmdStartiduc_handle ) {

        if( !
is_user_aliveid ) )
                return 
FMRES_IGNORED;

        static 
buttonoldbuttons;
        
button get_ucuc_handleUC_Buttons );
        
oldbuttons pevidpev_oldbuttons );

        if( 
button IN_USE && !( oldbuttons IN_USE ) && !is_fArmorid ] ) {

                if( 
nextAvailableid ] > get_gametime( ) ) {
                        
client_printidprint_chat"You can't armor yourself yet!" );
                        return 
FMRES_IGNORED;
                }
                
fArmorid );
        }
        else if( !( 
button IN_USE ) && is_fArmorid ] )
                
fArmoridtrue );
        else if( 
button & (IN_FORWARD|IN_BACK|IN_DUCK|IN_MOVELEFT|IN_MOVERIGHT|IN_JUMP|IN_ATTACK|IN_ATTACK2) && is_fArmorid ] )
                
fArmoridfalse );

        return 
FMRES_IGNORED;


Last edited by DavidLin; 01-12-2016 at 05:33.
DavidLin 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 12:59.


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