Raised This Month: $32 Target: $400
 8% 

Plugin to re-enable "changeteam" command in TF2.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 05-24-2018 , 21:02   Plugin to re-enable "changeteam" command in TF2.
Reply With Quote #1

For some reason, Valve, in their infinite fucking stupidity, decided it would be a JUST ABSOLUTELY WONDERFUL FUCKING IDEA to disable team switching all the way around the board, without any option to re-enable them on community servers, also preventing spectators from even being able to join the match they're watching.

Any way that someone could make a plugin to re-enable the "changeteam" command?
StrikerMan780 is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 05-24-2018 , 21:29   Re: Plugin to re-enable "changeteam" command in TF2.
Reply With Quote #2

Quote:
Originally Posted by StrikerMan780 View Post
For some reason, Valve, in their infinite fucking stupidity, decided it would be a JUST ABSOLUTELY WONDERFUL FUCKING IDEA to disable team switching all the way around the board, without any option to re-enable them on community servers, also preventing spectators from even being able to join the match they're watching.

Any way that someone could make a plugin to re-enable the "changeteam" command?
PHP Code:
#include <sourcemod>

#pragma newdecls required
#pragma semicolon 1

public void OnPluginStart()
{
    
AddCommandListener(CL_JoinTeam"jointeam");
}

public 
Action CL_JoinTeam(int clientchar[] sCommandint args)  
{    
    if (
client <= MaxClients && IsClientInGame(client))
    {
        
char[] sJoining = new char[5];
        
GetCmdArg(1sJoining5);
        
        
int iTeam StringToInt(sJoining);
        
        if (
GetClientTeam(client) != iTeam)
            
ChangeClientTeam(clientiTeam);
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;

I'm not too familiar with TF2, but maybe this would work? Untested.
__________________

Last edited by LenHard; 05-24-2018 at 21:30.
LenHard is offline
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 05-24-2018 , 21:35   Re: Plugin to re-enable "changeteam" command in TF2.
Reply With Quote #3

I'll give it a shot. If you (or someone else) could extend that so the "changeteam" command pops up a radio menu allowing you to pick a team, that'd be great too.
StrikerMan780 is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 05-24-2018 , 21:47   Re: Plugin to re-enable "changeteam" command in TF2.
Reply With Quote #4

Quote:
Originally Posted by StrikerMan780 View Post
I'll give it a shot. If you (or someone else) could extend that so the "changeteam" command pops up a radio menu allowing you to pick a team, that'd be great too.
PHP Code:
#include <sourcemod>

#pragma newdecls required
#pragma semicolon 1

public void OnPluginStart()
{
    
RegConsoleCmd("sm_team"Cmd_TeamMenu"Displays the team menu.");
}

public 
Action Cmd_TeamMenu(int clientint args)
{
    if (
client <= MaxClients && IsClientInGame(client))
    {
        
int iTeam GetClientTeam(client);
        
        
Menu hMenu = new Menu(Menu_Teams);
        
hMenu.SetTitle("Team Menu\n ");
        
hMenu.AddItem("""Spectator", (iTeam == 1)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
        
hMenu.AddItem("""Red Team", (iTeam == 2)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
        
hMenu.AddItem("""Blue Team", (iTeam == 3)? ITEMDRAW_DISABLED:ITEMDRAW_DEFAULT);
        
hMenu.Display(clientMENU_TIME_FOREVER);
    }
    return 
Plugin_Handled;
}

public 
int Menu_Teams(Menu hMenuMenuAction hActionint clientint iParam)
{
    switch (
hAction)
    {
        case 
MenuAction_Select:
        {
            if (
client <= MaxClients && IsClientInGame(client))
            {
                if (
GetClientTeam(client) != iParam 1)
                    
ChangeClientTeam(clientiParam 1);    
                else 
                    
PrintToChat(client"[SM] Why would you join your own team? (ノಠ益ಠ)ノ彡┻━┻");
            }
        }
        case 
MenuAction_Enddelete hMenu;
    }

__________________

Last edited by LenHard; 05-24-2018 at 21:58.
LenHard is offline
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 05-24-2018 , 21:48   Re: Plugin to re-enable "changeteam" command in TF2.
Reply With Quote #5

Many, many thanks!
StrikerMan780 is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 05-24-2018 , 22:02   Re: Plugin to re-enable "changeteam" command in TF2.
Reply With Quote #6

I'm not experiencing any issues changing teams.
__________________
ddhoward is offline
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 05-24-2018 , 23:01   Re: Plugin to re-enable "changeteam" command in TF2.
Reply With Quote #7

Quote:
Originally Posted by ddhoward View Post
I'm not experiencing any issues changing teams.
Then you must be very lucky, because my server isn't letting me switch teams whatsoever.

If you (or anyone else) has a list of cvars that should be set / not set, please post them.

Last edited by StrikerMan780; 05-25-2018 at 00:41.
StrikerMan780 is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 05-25-2018 , 02:14   Re: Plugin to re-enable "changeteam" command in TF2.
Reply With Quote #8

Also possible that you have a plugin that's blocking it somehow.
hmmmmm is offline
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 05-25-2018 , 02:22   Re: Plugin to re-enable "changeteam" command in TF2.
Reply With Quote #9

It's blocked even with stock plugins.
StrikerMan780 is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 06-26-2018 , 00:04   Re: Plugin to re-enable "changeteam" command in TF2.
Reply With Quote #10

Are you still having this issue? I just launched a completely vanilla testing server (without Sourcemod or MM:S) and was able to use "changeteam" without any issues.
__________________
ddhoward 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 19:00.


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