AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Plugin to re-enable "changeteam" command in TF2. (https://forums.alliedmods.net/showthread.php?t=307786)

StrikerMan780 05-24-2018 21:02

Plugin to re-enable "changeteam" command in TF2.
 
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?

LenHard 05-24-2018 21:29

Re: Plugin to re-enable "changeteam" command in TF2.
 
Quote:

Originally Posted by StrikerMan780 (Post 2593708)
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.

StrikerMan780 05-24-2018 21:35

Re: Plugin to re-enable "changeteam" command in TF2.
 
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.

LenHard 05-24-2018 21:47

Re: Plugin to re-enable "changeteam" command in TF2.
 
Quote:

Originally Posted by StrikerMan780 (Post 2593711)
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;
    }



StrikerMan780 05-24-2018 21:48

Re: Plugin to re-enable "changeteam" command in TF2.
 
Many, many thanks!

ddhoward 05-24-2018 22:02

Re: Plugin to re-enable "changeteam" command in TF2.
 
I'm not experiencing any issues changing teams.

StrikerMan780 05-24-2018 23:01

Re: Plugin to re-enable "changeteam" command in TF2.
 
Quote:

Originally Posted by ddhoward (Post 2593716)
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.

hmmmmm 05-25-2018 02:14

Re: Plugin to re-enable "changeteam" command in TF2.
 
Also possible that you have a plugin that's blocking it somehow.

StrikerMan780 05-25-2018 02:22

Re: Plugin to re-enable "changeteam" command in TF2.
 
It's blocked even with stock plugins.

ddhoward 06-26-2018 00:04

Re: Plugin to re-enable "changeteam" command in TF2.
 
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.


All times are GMT -4. The time now is 21:52.

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