clear forceteam on (dis)connect

This commit is contained in:
Robin Appelman 2020-03-29 22:25:22 +02:00
commit 3977bab1b7
2 changed files with 10 additions and 1 deletions

Binary file not shown.

View file

@ -17,6 +17,7 @@ public OnPluginStart() {
RegServerCmd("sm_forceteam", ForceExec, "Set a players team and keep them there"); RegServerCmd("sm_forceteam", ForceExec, "Set a players team and keep them there");
AddCommandListener(Command_JoinTeam, "jointeam"); AddCommandListener(Command_JoinTeam, "jointeam");
AddCommandListener(Command_JoinTeam, "autoteam");
} }
int parse_team(const char[] team_str) { int parse_team(const char[] team_str) {
@ -98,3 +99,11 @@ public Action:Command_JoinTeam(client, const String:command[], argc) {
return Plugin_Continue; return Plugin_Continue;
} }
} }
public void OnClientConnected(client) {
force_team[client] = 0;
}
public void OnClientDisconnect(client) {
force_team[client] = 0;
}