Raised This Month: $51 Target: $400
 12% 

[TF2] Disable classchange at spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jillchang917
Member
Join Date: Dec 2017
Old 01-30-2018 , 16:36   [TF2] Disable classchange at spawn
Reply With Quote #1

Anyone know how to disable classchange at spawn in TF2?
It's annoying when on custom maps they changeclass near spawn and it instantly respawns them avoiding death and cooldown.
jillchang917 is offline
Noodl
Member
Join Date: Jun 2015
Old 01-30-2018 , 20:08   Re: [TF2] Disable classchange at spawn
Reply With Quote #2

Hook the client touching the spawnroom entity, then use that with an AddCommandListener on jointeam or whatever it's called to block it.

Code:
public OnEntityCreated(iEntity, const char[] sClassname)
{
	if (StrEqual(sClassname, "func_respawnroom", false))	// This is the earliest we can catch this
	{
		SDKHook(iEntity, SDKHook_StartTouch, SpawnStartTouch);
		SDKHook(iEntity, SDKHook_EndTouch, SpawnEndTouch);
	}
}
Noodl is offline
jillchang917
Member
Join Date: Dec 2017
Old 01-30-2018 , 21:51   Re: [TF2] Disable classchange at spawn
Reply With Quote #3

Quote:
Originally Posted by Noodl View Post
Hook the client touching the spawnroom entity, then use that with an AddCommandListener on jointeam or whatever it's called to block it.

Code:
public OnEntityCreated(iEntity, const char[] sClassname)
{
	if (StrEqual(sClassname, "func_respawnroom", false))	// This is the earliest we can catch this
	{
		SDKHook(iEntity, SDKHook_StartTouch, SpawnStartTouch);
		SDKHook(iEntity, SDKHook_EndTouch, SpawnEndTouch);
	}
}
Thank you Noodl. Any chance you could make it into a simple plugin for me? The command is "joinclass"
I've searched everywhere for one that was premade but couldn't find one.

Last edited by jillchang917; 01-30-2018 at 21:52.
jillchang917 is offline
Noodl
Member
Join Date: Jun 2015
Old 02-04-2018 , 13:23   Re: [TF2] Disable classchange at spawn
Reply With Quote #4

I only just checked back on AM and saw this.

Haven't tested it, but should probably work.
Attached Files
File Type: sp Get Plugin or Get Source (nospawnchange.sp - 306 views - 1.4 KB)

Last edited by Noodl; 02-04-2018 at 13:24.
Noodl is offline
Reply



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 05:11.


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