Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Action Command_JoinTeam(int client, const char[]command, int args)
- {
- if (!IsActive(client, true))
- {
- return Plugin_Continue;
- }
- if (client == 0 || IsFakeClient(client))
- {
- return Plugin_Continue;
- }
- if ((g_match || g_t_knife) && GetClientTeam(client) > 1 && GetConVarBool(wm_lock_teams))
- {
- PrintToChat(client, "\x01 \x09[\x04%s\x09]\x01 %t", CHAT_PREFIX, "Change Teams Midgame");
- return Plugin_Stop;
- }
- PrintToChatAll("is first half = %d", firsthalfornot);
- PrintToChatAll("switchstatus= %d", switchstatus);
- PrintToChatAll("intermissioncount= %d", intermissioncount);
- char CommunityID[18];
- GetClientAuthId(client, AuthId_SteamID64, CommunityID, sizeof(CommunityID));
- for (int i = 0; i < 10; i++) {
- if(firsthalfornot && !switchstatus){
- if (strcmp(force_team_t[i], CommunityID, false) == 0) {
- PrintToChatAll("g_first_half && !switchstatus T");
- ChangeClientTeam(client, CS_TEAM_T);
- return Plugin_Stop;
- } else if (strcmp(force_team_ct[i], CommunityID, false) == 0) {
- PrintToChatAll("g_first_half && !switchstatus CT");
- ChangeClientTeam(client, CS_TEAM_CT);
- return Plugin_Stop;
- }
- else if(!firsthalfornot && switchstatus){
- if (strcmp(force_team_t[i], CommunityID, false) == 0) {
- PrintToChatAll("!g_first_half && switchstatus T");
- ChangeClientTeam(client, CS_TEAM_T);
- return Plugin_Stop;
- } else if (strcmp(force_team_ct[i], CommunityID, false) == 0) {
- PrintToChatAll("!g_first_half && switchstatus CT");
- ChangeClientTeam(client, CS_TEAM_CT);
- return Plugin_Stop;
- }
- }
- }
- else{
- if (strcmp(force_team_t[i], CommunityID, false) == 0) {
- PrintToChatAll("DEBUGJT: forced to ct");
- ChangeClientTeam(client, CS_TEAM_CT);
- return Plugin_Stop;
- } else if (strcmp(force_team_ct[i], CommunityID, false) == 0) {
- PrintToChatAll("DEBUGJT: forced to t");
- ChangeClientTeam(client, CS_TEAM_T);
- return Plugin_Stop;
- }
- }
- }
- return Plugin_Continue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement