Page 1 of 1

[SOLVED] Disabling Buttons for Activators

Posted: Fri Nov 07, 2008 11:13 pm
by shiftey
How would I go about disabling or locking a button for a player once he has used it, but still allow other players to use that button following the same principle?

Posted: Sat Nov 08, 2008 12:49 am
by TheMoon
OnPressed !activator AddOutput "targetname presser" 0.01

Set up a filter_activator_name which lets through everything except "presser". Add OnTrue outputs to the filter for the stuff you want to happen when the button is pressed. (onFalse for stuff you want to happen when someone presses for the second time).
The button itself has to get another output

OnPressed filter TestActivator 0.00

Posted: Sat Nov 08, 2008 2:16 am
by shiftey
Nice. Thanks, this helps a lot. How would I reset it so the player can use it again?

Posted: Sat Nov 08, 2008 9:52 am
by TheMoon
Just rename the player somehow (in the same way described in the first post), for example directly with the button (after a certain delay). Take any name except "presser".
Of course, any other constellation where you can refer to the player as "!activator" works as well, for example with triggers. These might be useful to reset respawning players for instance.