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

Solved [CSGO] auto teamname setter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jio
Junior Member
Join Date: Feb 2022
Location: Black Sea
Old 02-15-2022 , 08:13   [CSGO] auto teamname setter
Reply With Quote #1

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"

Last edited by Jio; 02-19-2022 at 00:31.
Jio is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-15-2022 , 10:16   Re: [CSGO] auto teamname setter
Reply With Quote #2

[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);
        }
    }


Last edited by Bacardi; 02-15-2022 at 21:24.
Bacardi is offline
Jio
Junior Member
Join Date: Feb 2022
Location: Black Sea
Old 02-17-2022 , 03:57   Re: [CSGO] auto teamname setter
Reply With Quote #3

Gonna try this, thank you very much
Jio is offline
Jio
Junior Member
Join Date: Feb 2022
Location: Black Sea
Old 02-17-2022 , 08:22   Re: [CSGO] auto teamname setter
Reply With Quote #4

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.

Last edited by Jio; 02-18-2022 at 05:21. Reason: Suggestions.
Jio is offline
lugowo
Junior Member
Join Date: Feb 2022
Location: Why do you care?
Old 02-21-2022 , 07:24   Re: [CSGO] auto teamname setter
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
[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,

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); 

Last edited by lugowo; 02-21-2022 at 07:25.
lugowo is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-21-2022 , 15:01   Re: [CSGO] auto teamname setter
Reply With Quote #6

Indeed. Silly me.
Bacardi is offline
raj kaul
Senior Member
Join Date: Mar 2018
Location: www.lotgaming.xyz
Old 02-23-2022 , 03:16   Re: [CSGO] auto teamname setter
Reply With Quote #7

I am not able to compile Bacardi's code with these 3 new line posted by lugowo , can some please help ? thank you
__________________
raj kaul is offline
lugowo
Junior Member
Join Date: Feb 2022
Location: Why do you care?
Old 02-23-2022 , 06:42   Re: [CSGO] auto teamname setter
Reply With Quote #8

Quote:
Originally Posted by raj kaul View Post
I am not able to compile Bacardi's code with these 3 new line posted by lugowo , can some please help ? thank you
uhmmmm...
lugowo is offline
Jio
Junior Member
Join Date: Feb 2022
Location: Black Sea
Old 02-25-2022 , 11:14   Re: [CSGO] auto teamname setter
Reply With Quote #9

Quote:
Originally Posted by raj kaul View Post
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?
Jio is offline
raj kaul
Senior Member
Join Date: Mar 2018
Location: www.lotgaming.xyz
Old 03-11-2022 , 01:46   Re: [CSGO] auto teamname setter
Reply With Quote #10

@Bacardi @lugowo can you please compile this plugin and send it here with halftime switch event ?
__________________
raj kaul is offline
Reply


Thread Tools
Display Modes

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 00:28.


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