AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   nvm (https://forums.alliedmods.net/showthread.php?t=189806)

iStrike 07-11-2012 06:27

nvm
 
How can I block pressing 'E' & 'Attack' together?
thanks guys :wink:

Napoleon_be 07-11-2012 10:31

Re: Help Block Two Buttons
 
PHP Code:

register_forward(FM_CmdStart"CmdStart"

PHP Code:

public CmdStart(idHandle) {
    if(
is_user_alive(id)) {
        static 
button
        button 
get_uc(HandleUC_Buttons)
        
        if (
button IN_ATTACK && button IN_USE) {
            
// button &= ~IN_ATTACK // Block attack 2 or Use. This is blocking Attack
            
button &= ~IN_USE // This blocks Use. I'd rather prefer blocking use while pressing both. So i comment button &= ~IN_ATTACK
        
}
        
        
set_uc(HandleUC_Buttonsbutton)
    }



iStrike 07-11-2012 10:48

Re: Help Block Two Buttons
 
Quote:

Originally Posted by Napoleon_be (Post 1748033)
PHP Code:

register_forward(FM_CmdStart"CmdStart"

PHP Code:

public CmdStart(idHandle) {
    if(
is_user_alive(id)) {
        static 
button
        button 
get_uc(HandleUC_Buttons)
        
        if (
button IN_ATTACK && button IN_USE) {
            
// button &= ~IN_ATTACK // Block attack 2 or Use. This is blocking Attack
            
button &= ~IN_USE // This blocks Use. I'd rather prefer blocking use while pressing both. So i comment button &= ~IN_ATTACK
        
}
        
        
set_uc(HandleUC_Buttonsbutton)
    }



Thanks :)


All times are GMT -4. The time now is 15:21.

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