Advertisement
Hyuna

Max Rounds V1.0

Nov 15th, 2012
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.06 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3.  
  4. new CTwin,Twin,g_cvar,g_maxplayers;
  5.  
  6. public plugin_init(){
  7.     register_plugin("Max Rounds","1.0","Hyuna");
  8.  
  9.     g_cvar = register_cvar("amx_max_rounds","10");
  10.     register_logevent("Event_CTWin",6,"3=CTs_Win","3=All_Hostages_Rescued");
  11.     register_logevent("Event_TerroristWin",6,"3=Terrorists_Win","3=Target_Bombed");
  12. }
  13.  
  14. public Event_CTWin(){
  15.     if (CTwin > get_pcvar_num(g_cvar))
  16.     {
  17.         for (new i = 1; i <= g_maxplayers; i++)
  18.         {
  19.             if (!is_user_connected(i))
  20.                 continue;
  21.  
  22.             switch (cs_get_user_team(i))
  23.             {
  24.                 case CS_TEAM_CT: cs_set_user_team(i,CS_TEAM_T);
  25.                 case CS_TEAM_T: cs_set_user_team(i,CS_TEAM_CT);
  26.             }
  27.         }
  28.         CTwin = 0;
  29.         return;
  30.     }
  31.  
  32.     CTwin++
  33. }
  34.  
  35. public Event_TerroristWin(){
  36.     if (Twin > get_pcvar_num(g_cvar))
  37.     {
  38.         for (new i = 1; i <= g_maxplayers; i++)
  39.         {
  40.             if (!is_user_connected(i))
  41.                 continue;
  42.  
  43.             switch (cs_get_user_team(i))
  44.             {
  45.                 case CS_TEAM_CT: cs_set_user_team(i,CS_TEAM_T);
  46.                 case CS_TEAM_T: cs_set_user_team(i,CS_TEAM_CT);
  47.             }
  48.         }
  49.         Twin = 0;
  50.         return;
  51.     }
  52.  
  53.     Twin++
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement