AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved [CSGO] auto teamname setter (https://forums.alliedmods.net/showthread.php?t=336377)

Jio 02-15-2022 08:13

[CSGO] auto teamname setter
 
Hello i'd like plugin that sets the teamname automatically based on the clients (including bots) in the server.

Example:
If there is player named "soldierboy" in the CT team, the plugin should change the teamname of the CT Team to "team_soldierboy"

Bacardi 02-15-2022 10:16

Re: [CSGO] auto teamname setter
 
[CSGO] Make get5 recognize BOTs as clients?




*edit
PHP Code:



public void OnPluginStart()
{
    
HookEvent("player_team"player_team);

}


public 
void player_team(Event event, const char[] namebool dontBroadcast)
{
/*
Server event "player_team", Tick 24180:
- "userid" = "5"
- "team" = "3"
- "oldteam" = "0"
- "disconnect" = "0"
- "autoteam" = "0"
- "silent" = "0"
- "isbot" = "1"
*/
    
static ConVar mp_teamname_1;
    static 
ConVar mp_teamname_2;

    if(
event.GetBool("disconnect"))
        return;

    
int team event.GetInt("team");

    if(
team 2)
        return;

    
int client GetClientOfUserId(event.GetInt("userid"));

    
char buffer[MAX_NAME_LENGTH];
    
Format(buffersizeof(buffer), "team_%N"client);

    switch(
team)
    {
        case 
2:
        {
            if(
mp_teamname_2 == null)
            {
                
mp_teamname_2 FindConVar("mp_teamname_2");
                
                if(
mp_teamname_2 == nullSetFailState("This game not have Console Variable mp_teamname_2");
            }
            
            
mp_teamname_2.SetString(buffer);
        }
        case 
3:
        {
            if(
mp_teamname_1 == null)
            {
                
mp_teamname_1 FindConVar("mp_teamname_1");
                
                if(
mp_teamname_1 == nullSetFailState("This game not have Console Variable mp_teamname_1");
            }
            
            
mp_teamname_1.SetString(buffer);
        }
    }



Jio 02-17-2022 03:57

Re: [CSGO] auto teamname setter
 
Gonna try this, thank you very much

Jio 02-17-2022 08:22

Re: [CSGO] auto teamname setter
 
Hello, is there a way to add this to the get5 matchconfig?
It resets the teamname whenever i start a manual match in get5.

You could also add a command that enable/disable the plugin.

lugowo 02-21-2022 07:24

Re: [CSGO] auto teamname setter
 
Quote:

Originally Posted by Bacardi (Post 2771533)
[CSGO] Make get5 recognize BOTs as clients?




*edit
PHP Code:



public void OnPluginStart()
{
    
HookEvent("player_team"player_team);

}


public 
void player_team(Event event, const char[] namebool dontBroadcast)
{
/*
Server event "player_team", Tick 24180:
- "userid" = "5"
- "team" = "3"
- "oldteam" = "0"
- "disconnect" = "0"
- "autoteam" = "0"
- "silent" = "0"
- "isbot" = "1"
*/
    
static ConVar mp_teamname_1;
    static 
ConVar mp_teamname_2;

    if(
event.GetBool("disconnect"))
        return;

    
int team event.GetInt("team");

    if(
team 2)
        return;

    
int client GetClientOfUserId(event.GetInt("userid"));

    
char buffer[MAX_NAME_LENGTH];
    
Format(buffersizeof(buffer), "team_%N"client);

    switch(
team)
    {
        case 
2:
        {
            if(
mp_teamname_2 == null)
            {
                
mp_teamname_2 FindConVar("mp_teamname_2");
                
                if(
mp_teamname_2 == nullSetFailState("This game not have Console Variable mp_teamname_2");
            }
            
            
mp_teamname_2.SetString(buffer);
        }
        case 
3:
        {
            if(
mp_teamname_1 == null)
            {
                
mp_teamname_1 FindConVar("mp_teamname_1");
                
                if(
mp_teamname_1 == nullSetFailState("This game not have Console Variable mp_teamname_1");
            }
            
            
mp_teamname_1.SetString(buffer);
        }
    }



lmao u forgot about the halfswitch, :nono:

PHP Code:

    g_hHalftimeTeamswitch CreateConVar("teamname_halftime_teamswitch""0""Plugin will switch team names at half time.");
    
g_bHalftimeTeamswitch GetConVarBool(g_hHalftimeTeamswitch);
    
HookConVarChange(g_hHalftimeTeamswitchOnConvarChanged); 


Bacardi 02-21-2022 15:01

Re: [CSGO] auto teamname setter
 
Indeed. Silly me.

raj kaul 02-23-2022 03:16

Re: [CSGO] auto teamname setter
 
I am not able to compile Bacardi's code with these 3 new line posted by lugowo , can some please help ? thank you

lugowo 02-23-2022 06:42

Re: [CSGO] auto teamname setter
 
Quote:

Originally Posted by raj kaul (Post 2772193)
I am not able to compile Bacardi's code with these 3 new line posted by lugowo , can some please help ? thank you

uhmmmm...

Jio 02-25-2022 11:14

Re: [CSGO] auto teamname setter
 
Quote:

Originally Posted by raj kaul (Post 2772193)
I am not able to compile Bacardi's code with these 3 new line posted by lugowo , can some please help ? thank you

Yes i also tried to compile, it doesn't work.
I think he is trolling?

raj kaul 03-11-2022 01:46

Re: [CSGO] auto teamname setter
 
@Bacardi @lugowo can you please compile this plugin and send it here with halftime switch event ?


All times are GMT -4. The time now is 13:36.

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