View Single Post
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 10-21-2020 , 01:56   Re: Trigger a button like func_door?
Reply With Quote #4

Code:
public void OnPluginStart()
{
	HookEntityOutput("func_button", "OnPressed", OnButtonPressed);
}

public void OnButtonPressed(const char[] output, int caller, int activator, float delay)
{
	if (activator > 0 && activator <= MaxClients && GetClientTeam(activator) == 3)
		PrintToChatAll("%N has pressed a button.", activator);
}
Think I misunderstood what you meant by using ent "func_door", this should work for buttons and only be called if you're a CT.
Drixevel is offline