Raised This Month: $319 Target: $400
 79%   Almost there!

switched from team <Unassigned> to <CT>


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kris Kristensen
Junior Member
Join Date: May 2020
Old 05-14-2020 , 10:40   switched from team <Unassigned> to <CT>
Reply With Quote #1

Hi all,

This is from the server whenever a player selects to join either the <T> or the <CT> team

Is there a way to capture this, when this switch happens, like a forward or hook?

Best
Kris
Kris Kristensen is offline
tair
Junior Member
Join Date: Apr 2015
Location: OnGameFrame()
Old 05-14-2020 , 11:06   Re: switched from team <Unassigned> to <CT>
Reply With Quote #2

Here an example to hook that:

PHP Code:
#include <sourcemod>
#include <cstrike>

public OnPluginStart( ) 
{
    
AddCommandListener(SelectTeam"jointeam");
}

public 
Action SelectTeam(int client, const char[] commandint args)
{
    
char sTeamName[8];
    
GetCmdArg(1sTeamNamesizeof(sTeamName)) ;// Get Team Name 
    
int team StringToInt(sTeamName);
    
    if (
team == CS_TEAM_SPEC// Spectator
    
{
        
//Do stuff
    
}
    else if(
team == CS_TEAM_TERRORIST//  Terrorist
    
{
        
//Do stuff
    
}
    else 
// Counter-Terrorist
    
{
        
//Do stuff
    
}
    
    return 
Plugin_Continue;

tair is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 05-14-2020 , 11:34   Re: switched from team <Unassigned> to <CT>
Reply With Quote #3

Code:
PutClientInServer: no info_player_start on level
Server event "player_spawn", Tick 17311:
- "userid" = "3"
- "teamnum" = "0"
Server event "player_activate", Tick 17311:
- "userid" = "3"
Server event "round_end_upload_stats", Tick 17535:
Server event "round_start", Tick 17535:
- "timelimit" = "180"
- "fraglimit" = "0"
- "objective" = "BOMB TARGET"
Server event "player_connect_full", Tick 17548:
- "userid" = "3"
- "index" = "0"
Server event "cs_round_start_beep", Tick 17664:
Server event "cs_round_start_beep", Tick 17728:
Server event "cs_round_start_beep", Tick 17792:
Server event "cs_round_final_beep", Tick 17855:
Server event "round_freeze_end", Tick 17855:
Server event "round_announce_match_start", Tick 17855:
Server event "player_team", Tick 18165:
- "userid" = "3"
- "team" = "1"
- "oldteam" = "0"
- "disconnect" = "0"
- "autoteam" = "0"
- "silent" = "0"
- "isbot" = "0"
Server event "switch_team", Tick 18165:
- "numPlayers" = "0"
- "numSpectators" = "1"
- "avg_rank" = "0"
- "numTSlotsFree" = "10"
- "numCTSlotsFree" = "10"

About "jointeam" command.
- It's command, never know do player actually moved in team where he wanted to.
- In CSGO, "jointeam" command have two arguments:
jointeam <team_index> <switch_team_instantly>
- if second argument is false, player would be moved to team on round_end (pending in team)
- if second argument is true, player change team immediately
__________________
Do not Private Message @me
Bacardi is offline
dustinandband
Senior Member
Join Date: May 2015
Old 05-15-2020 , 11:15   Re: switched from team <Unassigned> to <CT>
Reply With Quote #4

Quote:
Originally Posted by Bacardi View Post
Code:
PutClientInServer: no info_player_start on level
Server event "player_spawn", Tick 17311:
- "userid" = "3"
- "teamnum" = "0"
Server event "player_activate", Tick 17311:
- "userid" = "3"
Server event "round_end_upload_stats", Tick 17535:
Server event "round_start", Tick 17535:
- "timelimit" = "180"
- "fraglimit" = "0"
- "objective" = "BOMB TARGET"
Server event "player_connect_full", Tick 17548:
- "userid" = "3"
- "index" = "0"
Server event "cs_round_start_beep", Tick 17664:
Server event "cs_round_start_beep", Tick 17728:
Server event "cs_round_start_beep", Tick 17792:
Server event "cs_round_final_beep", Tick 17855:
Server event "round_freeze_end", Tick 17855:
Server event "round_announce_match_start", Tick 17855:
Server event "player_team", Tick 18165:
- "userid" = "3"
- "team" = "1"
- "oldteam" = "0"
- "disconnect" = "0"
- "autoteam" = "0"
- "silent" = "0"
- "isbot" = "0"
Server event "switch_team", Tick 18165:
- "numPlayers" = "0"
- "numSpectators" = "1"
- "avg_rank" = "0"
- "numTSlotsFree" = "10"
- "numCTSlotsFree" = "10"

About "jointeam" command.
- It's command, never know do player actually moved in team where he wanted to.
- In CSGO, "jointeam" command have two arguments:
jointeam <team_index> <switch_team_instantly>
- if second argument is false, player would be moved to team on round_end (pending in team)
- if second argument is true, player change team immediately
What debug script do you use to get output like that? I didn’t even know that was possible all these years holy shit that would’ve made life so much easier...
dustinandband is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 05-15-2020 , 11:30   Re: switched from team <Unassigned> to <CT>
Reply With Quote #5

sm_cvar net_showevents 2

I have seen couple times that it not show all events, until you run bots on server or hook event with plugin :/
__________________
Do not Private Message @me
Bacardi 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 21:14.


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