Coded button?

I found a “Coded button” a few years back. But i cant find it now. :frowning:

It worked like only a few players could use it. Desided either by “team”, Steam ID, name or something in the player name. Worked like wonders for making bases or other doors or traps. So i were hoping either someone could redirect me to it, upload it or maybe recreate it.

You can do it by name or steamid with wire, You would use a button, multiply, and Target finder

This can easily be done using Expression2.
However, this needs the (almost) latest Wire to work. Make sure the server you’re on has the latest wire.

To make it work:
Get the Wire Button Tool. Check the checkbox saying “Output ID”. Make it non-toggle.
Spawn the E2.
Wire “Button” to the Button’s “Out” output.
Wire “ButtonID” to the Button’s “ID” output. (Names of the button’s outputs may be different, can’t remember exactly)
Edit the E2 code, with as many SteamIDs as you want.


@name SteamID Checker
@inputs Button ButtonID
@outputs Out
@persist Allowed:array
if (first()|duped()) {
	Allowed:pushString("STEAM_0:0:00000") #Put your steamid here
	Allowed:pushString("STEAM_0:0:00000") #Put someone elses steamid here
	#Copy the above "Allowed:pushStr....." and paste it as many times as you like.
}
if (Button & ~Button) {
	for(I=1,Allowed:count()) {#Loop through all the steamIDs
		if (entity(ButtonID) == Allowed:string(I)) { #If the steamID of the player who pushed the button is equal to the steamID currently being checked..
			Out = 1 #Set Out to 1
			timer("ResetOut",50) #Start a timer.
			break #Exit the loop. No need to continue looping through the rest of the IDs when we've already found the one we were looking for.
		}
	}
}
if (clk("ResetOut")) {Out = 0} #Reset Out back to 0

If you want, I can change it to work with names, or parts of names, if you’d rather have that.

NOTE: Also posted here: http://www.facepunch.com/showthread.php?t=765410&page=7
:slight_smile:

if (ent(ButtonID) == Allowed:string(I)) { #If the steamID of the player who pushed the button is equal to the steamID currently being checked…

No such function ent(Number)

That’s what the error gives.

-snip-

the one i found were a non wire button. :-/ easy and simple to use. wish i could give you a better description but it’s a long time since i last had that addon.

Crap. It’s


entity(Number)

Editing the code. It should work now.