HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4.  
  5. new roundcounter, swap_teams_round;
  6.  
  7. public plugin_init()
  8. {
  9. register_plugin("Swap Teams","0.6","addam")
  10. register_dictionary("swapteams.txt")
  11. swap_teams_round = register_cvar("swap_teams_round","3");
  12. register_event("SendAudio","noveld","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
  13. }
  14.  
  15. public noveld()
  16. {
  17. roundcounter++;
  18. if (roundcounter >= get_pcvar_num(swap_teams_round)) {
  19. set_task(2.0,"korvege");
  20. roundcounter = 0;
  21. }
  22. }
  23.  
  24. public korvege()
  25. {
  26. client_print(0,print_chat,"%L",0,"SWAP_1");
  27. set_task(1.0,"Event_Round_End");
  28. }
  29.  
  30. public Event_Round_End(){
  31. set_cvar_num("mp_limitteams", 0)
  32. new CsTeams:team
  33. new Players[32]
  34. new playerCount, i, player
  35. get_players(Players, playerCount, "h")
  36. for (i=0; i<playerCount; i++) {
  37. player = Players[i]
  38.  
  39. team=cs_get_user_team(player)
  40. if(team==CS_TEAM_CT)cs_set_user_team(player, CS_TEAM_T)
  41. else if(team==CS_TEAM_T)cs_set_user_team(player, CS_TEAM_CT)
  42. cs_reset_user_model(player)
  43. }
  44. set_cvar_num("mp_limitteams", 1)
  45. set_task(6.0,"rezetmodelsz");
  46. }
  47.  
  48. public rezetmodelsz() {
  49. new Players[32]
  50. new playerCount, i, player
  51. get_players(Players, playerCount, "h")
  52. for (i=0; i<playerCount; i++) {
  53. player = Players[i]
  54. cs_reset_user_model(player)
  55. }
  56.  
  57. }