Raised This Month: $ Target: $400
 0% 

Block IN_JUMP when player hold another button


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 03-21-2014 , 01:30   Block IN_JUMP when player hold another button
Reply With Quote #1

Hi everybody, well im trying to block IN_JUMP button when a player hold right, left and forward button at the same time, but i want to activate the button IN_JUMP again when the player stop hold this buttons i mean left, right and forward button, i found a code of connor but i dunno how i can make to block jump button when the player hold the buttons that i mentioned, then when this stop hold button i want to enable the IN_JUMP button again, how i can make this? can someone help me.. thx in advance

another thing can u tell me if the code is fine?

code:

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_FORWARD && buttonPressed IN_MOVERIGHT && buttonPressed IN_MOVELEFT
    { 
       
set_pevidpev_oldbuttonspevidpev_oldbuttons ) | IN_JUMP )
    } 
    else if(
buttonReleased  IN_FORWARD && buttonReleased  IN_MOVERIGHT && buttonReleased  IN_MOVELEFT
    { 
        
set_pevidpev_oldbuttonspevidpev_oldbuttons ) & ~IN_JUMP )
    } 


Last edited by wicho; 03-21-2014 at 13:47.
wicho is offline
 


Thread Tools
Display Modes

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 05:59.


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