[SOLVED] Disabling Buttons for Activators

Need Help? The Day isnt going so well on the Mapping front?
Post Reply
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

[SOLVED] Disabling Buttons for Activators

Post 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?
Last edited by shiftey on Fri Sep 18, 2009 1:27 am, edited 1 time in total.
TheMoon
prop_static
prop_static
Posts: 89
Joined: Thu May 10, 2007 9:13 pm

Post 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
shiftey
npc_combinegunship
npc_combinegunship
Posts: 705
Joined: Thu Oct 09, 2008 4:45 pm
Contact:

Post by shiftey »

Nice. Thanks, this helps a lot. How would I reset it so the player can use it again?
TheMoon
prop_static
prop_static
Posts: 89
Joined: Thu May 10, 2007 9:13 pm

Post 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.
Post Reply