Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #define PLUGIN "InHouse League Server Plugin"
- #define VERSION "1.0"
- #define AUTHOR "ARR9GAN7"
- #pragma semicolon 1
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- register_srvcmd( "ihl_switchteams", "switchteams" );
- }
- public switchteams( id, level, cid )
- {
- if( !cmd_access( id, level, cid, 1 ) )
- return PLUGIN_HANDLED;
- new players[32], num;
- get_players( players, num );
- client_print( 0, print_center, "[InHouse League]: Switching all Players...");
- for( new i; i < num; i++ )
- add_delay( players[i] ); // Prevent Server Crash with a lot of people.
- return PLUGIN_HANDLED;
- }
- public changeTeam( id )
- {
- switch( cs_get_user_team( id ) )
- {
- case CS_TEAM_CT: cs_set_user_team( id, CS_TEAM_T );
- case CS_TEAM_T: cs_set_user_team( id, CS_TEAM_CT );
- }
- }
- add_delay( id )
- {
- switch( id )
- {
- case 1..7: set_task( 0.1, "changeTeam", id );
- case 8..15: set_task( 0.2, "changeTeam", id );
- case 16..23: set_task( 0.3, "changeTeam", id );
- case 24..32: set_task( 0.4, "changeTeam", id );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement