Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. public Action Command_JoinTeam(int client, const char[]command, int args)
  2. {
  3. if (!IsActive(client, true))
  4. {
  5. return Plugin_Continue;
  6. }
  7.  
  8. if (client == 0 || IsFakeClient(client))
  9. {
  10. return Plugin_Continue;
  11. }
  12.  
  13. if ((g_match || g_t_knife) && GetClientTeam(client) > 1 && GetConVarBool(wm_lock_teams))
  14. {
  15. PrintToChat(client, "\x01 \x09[\x04%s\x09]\x01 %t", CHAT_PREFIX, "Change Teams Midgame");
  16. return Plugin_Stop;
  17. }
  18. PrintToChatAll("is first half = %d", firsthalfornot);
  19. PrintToChatAll("switchstatus= %d", switchstatus);
  20. PrintToChatAll("intermissioncount= %d", intermissioncount);
  21. char CommunityID[18];
  22. GetClientAuthId(client, AuthId_SteamID64, CommunityID, sizeof(CommunityID));
  23. for (int i = 0; i < 10; i++) {
  24. if(firsthalfornot && !switchstatus){
  25. if (strcmp(force_team_t[i], CommunityID, false) == 0) {
  26. PrintToChatAll("g_first_half && !switchstatus T");
  27. ChangeClientTeam(client, CS_TEAM_T);
  28. return Plugin_Stop;
  29. } else if (strcmp(force_team_ct[i], CommunityID, false) == 0) {
  30. PrintToChatAll("g_first_half && !switchstatus CT");
  31. ChangeClientTeam(client, CS_TEAM_CT);
  32. return Plugin_Stop;
  33. }
  34. else if(!firsthalfornot && switchstatus){
  35. if (strcmp(force_team_t[i], CommunityID, false) == 0) {
  36. PrintToChatAll("!g_first_half && switchstatus T");
  37. ChangeClientTeam(client, CS_TEAM_T);
  38. return Plugin_Stop;
  39. } else if (strcmp(force_team_ct[i], CommunityID, false) == 0) {
  40. PrintToChatAll("!g_first_half && switchstatus CT");
  41. ChangeClientTeam(client, CS_TEAM_CT);
  42. return Plugin_Stop;
  43. }
  44. }
  45. }
  46. else{
  47. if (strcmp(force_team_t[i], CommunityID, false) == 0) {
  48. PrintToChatAll("DEBUGJT: forced to ct");
  49. ChangeClientTeam(client, CS_TEAM_CT);
  50. return Plugin_Stop;
  51. } else if (strcmp(force_team_ct[i], CommunityID, false) == 0) {
  52. PrintToChatAll("DEBUGJT: forced to t");
  53. ChangeClientTeam(client, CS_TEAM_T);
  54. return Plugin_Stop;
  55. }
  56. }
  57. }
  58.  
  59.  
  60. return Plugin_Continue;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement