AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   switched from team <Unassigned> to <CT> (https://forums.alliedmods.net/showthread.php?t=324374)

Kris Kristensen 05-14-2020 10:40

switched from team <Unassigned> to <CT>
 
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

tair 05-14-2020 11:06

Re: switched from team <Unassigned> to <CT>
 
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;



Bacardi 05-14-2020 11:34

Re: switched from team <Unassigned> to <CT>
 
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

dustinandband 05-15-2020 11:15

Re: switched from team <Unassigned> to <CT>
 
Quote:

Originally Posted by Bacardi (Post 2700129)
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...

Bacardi 05-15-2020 11:30

Re: switched from team <Unassigned> to <CT>
 
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 :/


All times are GMT -4. The time now is 07:05.

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