AlliedModders

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

BioHazardousWaste 04-24-2005 23:52

+mycommand?
 
Um... v3x mentioned this to me, and it sounds like I could really use it. How do you have something happen while the button is held down, but when released it is stopped? Thanx

xeroblood 04-25-2005 09:05

Code:
public plugin_init() {     register_clcmd( "+my_command", "ClCmd_Hold",    -1, "" )     register_clcmd( "-my_command",  "ClCmd_Release", -1, "" )     } public ClCmd_Hold( id ) {     // user is holding key down } public ClCmd_Release( id ) {     // user released button }

The beauty of this is that, you only have to bind the + command, and when you let go of the button, HL automatically calls the - command for you..

I hope that helps..

BioHazardousWaste 04-25-2005 15:49

Perfect... thanx :)


All times are GMT -4. The time now is 16:37.

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