View Single Post
Author Message
Requiesta
Senior Member
Join Date: May 2012
Location: Texas
Old 04-16-2017 , 12:55   [TF2] Prevent Sentry Placement
Reply With Quote #1

I've looked at a lot of different threads and tutorials on this site and others on how to block sentries from being placed. If someone else posted this, please delete this one but I couldn't find it after searching for a good 10 minutes.

Code:
// Block Sentries
public OnEntityCreated(iEnt, const String:classname[])
{
	if(!IsValidEntity(iEnt))
		return;
	
	if(StrEqual(classname, "obj_sentrygun"))
	{
		AcceptEntityInput(iEnt, "Kill");
	}
}
In-game this prevents the sentry blueprint from even showing up and I can't circumvent it through the build menu. I tried the Command Listener version but it could be circumvented.
__________________
YouTuber, Modder, Accountant, and somehow I still enjoy programming after all that.

Check out my YouTube Channel.
Requiesta is offline