Raised This Month: $ Target: $400
 0% 

Prevent class change in TF2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 02-26-2017 , 15:46   Re: Prevent class change in TF2
Reply With Quote #1

You can block the player from joining team instead.

Code:
public void OnPluginStart()
{
	AddCommandListener(Hook_JoinTeam, "jointeam");
}

public Action Hook_JoinTeam(int client, const char[] command, int argc)
{
	return Plugin_Handled;
}
Should probably "return Plugin_Continue;" when player is in spectate mode.
__________________
Chaosxk is offline
cidra
Junior Member
Join Date: Jun 2016
Location: Italy
Old 02-28-2017 , 10:16   Re: Prevent class change in TF2
Reply With Quote #2

Quote:
Originally Posted by Chaosxk View Post
You can block the player from joining team instead.

Code:
public void OnPluginStart()
{
	AddCommandListener(Hook_JoinTeam, "jointeam");
}

public Action Hook_JoinTeam(int client, const char[] command, int argc)
{
	return Plugin_Handled;
}
Should probably "return Plugin_Continue;" when player is in spectate mode.
Is there no way to do that with HookEvent? Using AddComandListener what should i do in case someone types jointeam auto? (Or simply, selects "auto" in the team select menu)
cidra 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 21:34.


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