Raised This Month: $146 Target: $400
 36% 

[TF2] Prevent Sentry Placement


Post New Thread Reply   
 
Thread Tools Display Modes
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.
__________________
I mod and map for the intox gaming community! In fact I mod and map more than I play the actual game
Requiesta is offline
404UserNotFound
( ͡ ͜ʖ ͡)
Join Date: Dec 2011
Location: 🍁
Old 04-16-2017 , 14:48   Re: [TF2] Prevent Sentry Placement
Reply With Quote #2

Set up a command listener, listen for the build command, then just kill the entity.
__________________
I'm not a SourcePawn expert, I just play one on TV.
Want to join the new SourceMod Discord? Send me a PM!


Last edited by 404UserNotFound; 04-16-2017 at 16:25.
404UserNotFound is online now
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 04-16-2017 , 15:04   Re: [TF2] Prevent Sentry Placement
Reply With Quote #3

Quote:
Originally Posted by abrandnewday View Post
Set up a command listener, listen for the build command, then just kill the entity.
No don't kill the entity, the whole purpose of a command listener block is that we don't get that far
__________________
Pelipoika is offline
404UserNotFound
( ͡ ͜ʖ ͡)
Join Date: Dec 2011
Location: 🍁
Old 04-16-2017 , 16:24   Re: [TF2] Prevent Sentry Placement
Reply With Quote #4

Quote:
Originally Posted by Pelipoika View Post
No don't kill the entity, the whole purpose of a command listener block is that we don't get that far
Oh yeah. Derp. Giving advice when you've just woken up within the past half hour is a bad idea lol.
__________________
I'm not a SourcePawn expert, I just play one on TV.
Want to join the new SourceMod Discord? Send me a PM!

404UserNotFound is online now
Requiesta
Senior Member
Join Date: May 2012
Location: Texas
Old 04-23-2017 , 00:28   Re: [TF2] Prevent Sentry Placement
Reply With Quote #5

What I ended up doing for the mod is both. I kill the entity on creation and block the command listener. Doing either alone seemed to create small windows for players to place sentries, somehow. Doing both seems to have completely blocked em.
__________________
I mod and map for the intox gaming community! In fact I mod and map more than I play the actual game
Requiesta is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:39.


Powered by vBulletin®
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Theme made by Freecode