Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4.  
  5. #define PLUGIN "InHouse League Server Plugin"
  6. #define VERSION "1.0"
  7. #define AUTHOR "ARR9GAN7"
  8.  
  9. #pragma semicolon 1
  10.  
  11. public plugin_init()
  12. {
  13. register_plugin(PLUGIN, VERSION, AUTHOR);
  14. register_srvcmd( "ihl_switchteams", "switchteams" );
  15. }
  16.  
  17. public switchteams( id, level, cid )
  18. {
  19. if( !cmd_access( id, level, cid, 1 ) )
  20. return PLUGIN_HANDLED;
  21. new players[32], num;
  22. get_players( players, num );
  23. client_print( 0, print_center, "[InHouse League]: Switching all Players...");
  24. for( new i; i < num; i++ )
  25. add_delay( players[i] ); // Prevent Server Crash with a lot of people.
  26. return PLUGIN_HANDLED;
  27. }
  28.  
  29. public changeTeam( id )
  30. {
  31. switch( cs_get_user_team( id ) )
  32. {
  33. case CS_TEAM_CT: cs_set_user_team( id, CS_TEAM_T );
  34.  
  35. case CS_TEAM_T: cs_set_user_team( id, CS_TEAM_CT );
  36. }
  37. }
  38.  
  39. add_delay( id )
  40. {
  41. switch( id )
  42. {
  43. case 1..7: set_task( 0.1, "changeTeam", id );
  44. case 8..15: set_task( 0.2, "changeTeam", id );
  45. case 16..23: set_task( 0.3, "changeTeam", id );
  46. case 24..32: set_task( 0.4, "changeTeam", id );
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement