AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   CS:GO Plugin that prevents team change. (https://forums.alliedmods.net/showthread.php?t=260639)

krikus62 03-28-2015 17:59

CS:GO Plugin that prevents team change.
 
Is there a plugin for CS:GO that prevents players to change team after they have been assigned to one?

Wilczek 03-28-2015 18:09

Re: CS:GO Plugin that prevents team change.
 
Here you go.

PHP Code:

#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION    "1.0"

new Handle:g_hLocked INVALID_HANDLE;

public 
OnPluginStart()
{
    
AddCommandListener(Command_JoinTeam"jointeam");
    
g_hLocked CreateConVar("sm_lock_teams""1""Enable or disable locking teams during match"FCVAR_NOTIFY);
}

public 
Action:Command_JoinTeam(client, const String:command[], args)
{    
    if (
client != 0)
    {
        if(
IsClientInGame(client) && !IsFakeClient(client))
        {
            if (
GetClientTeam(client) > && GetConVarBool(g_hLocked))
            {
                
PrintToChat(client"\x01 \x07You cannot change your team during a match!");
                return 
Plugin_Stop;
            }
        }
    }

    return 
Plugin_Continue;



krikus62 03-29-2015 17:26

Re: CS:GO Plugin that prevents team change.
 
Wow thank you so much! This works perfectly!

Apina 05-28-2015 11:37

Re: CS:GO Plugin that prevents team change.
 
Dosent work for csgo still players can change team when they assigned to one

krikus62 05-28-2015 11:56

Re: CS:GO Plugin that prevents team change.
 
Check your logs, it should work, as I am still running it.

Apina 05-28-2015 11:58

Re: CS:GO Plugin that prevents team change.
 
Quote:

Originally Posted by krikus62 (Post 2302074)
Check your logs, it should work, as I am still running it.

my server using 120 slots and csgo teamlimits to access 64 players play at standard maps, i am compiled this plugin dosent work still players when they choose team they can switch team.

sirc86 01-28-2017 16:08

Re: CS:GO Plugin that prevents team change.
 
Hello,

Can someone adding to plugin, exception to admins to be able to move to spectators ?

Thank you!

Schpraaankiii 09-22-2017 11:30

Re: CS:GO Plugin that prevents team change.
 
Hey guys. I need somehting like this as well. Anyone out there with some skills?

Silvsilver 11-27-2017 16:30

Re: CS:GO Plugin that prevents team change.
 
Quote:

Originally Posted by Schpraaankiii (Post 2550237)
Hey guys. I need somehting like this as well. Anyone out there with some skills?

I need this too? found something?

PinHeaDi 11-28-2017 22:12

Re: CS:GO Plugin that prevents team change.
 
PHP Code:

#include <sourcemod>

bool ClientInGame[MAXPLAYERS 1];
ConVar AllowAdmins;

public 
void OnPluginStart()
{
    
AddCommandListener(Command_JoinTeam"jointeam");
    
AllowAdmins CreateConVar("sm_gotospec_allow_admins""1""Allow admins to go to spectator team? [1 - true, 0 - false]."0true0.0true1.0);
}

public 
void OnClientPutInServer(int client)
{
    
ClientInGame[client] = false;
}

public 
Action Command_JoinTeam(int clientchar[] commandint args)  
{
    
char TeamName[8];
    
GetCmdArg(1TeamNamesizeof(TeamName));
    
int Team StringToInt(TeamName);


    if (
CheckCommandAccess(client"sm_command"ADMFLAG_GENERICtrue) && AllowAdmins.BoolValue)
    {
        if (
Team >= 1){return Plugin_Continue;}
        else{
            return 
Plugin_Handled;
        }
    }
    
    if (!
ClientInGame[client])
    {
        switch (
Team){
            case 
2,3: {ClientInGame[client] = true; return Plugin_Continue;}
            default: return 
Plugin_Handled;
        } 
    }
    
    if (
ClientInGame[client])
    {
        switch (
Team){
            default: return 
Plugin_Handled;
        }
     }
    
     return 
Plugin_Continue;


This should work, it should block the auto-pick option too.


All times are GMT -4. The time now is 15:18.

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