AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check if button is released (https://forums.alliedmods.net/showthread.php?t=214812)

darktemplar 04-29-2013 21:58

Check if button is released
 
Hi ,
I want to make a special weapon, you press E to change to Charge Mode, after that, to active the special function, you have to hold Attack button, when you want to open your fire, you release it

The problem I have is how can I check if IN_ATTACK released?
Can someone give me a solution ? :)

hornet 04-29-2013 22:23

Re: Check if button is released
 
Something like this in a think forward:
Code:
    static Button, OldButton;         Button = pev( id, pev_button );     OldButton = pev( id, pev_oldbuttons );         if( ( OldButton & IN_ATTACK ) && !( Button & IN_ATTACK ) )         //fire weapon here


All times are GMT -4. The time now is 10:52.

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