Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <cstrike>
- #pragma newdecls required
- public Plugin myinfo =
- {
- name = "BOT kicker",
- author = "",
- description = "",
- version = "0.0.1a",
- url = ""
- };
- public void OnPluginStart()
- {
- HookEvent("player_team", Event_PlayerTeam, EventHookMode_Pre);
- }
- public Action Event_PlayerTeam(Event event, const char[] name, bool dontBroadcast)
- {
- event.SetBool("silent", true);
- if( RealPlayersCount() > 1 )
- {
- return Plugin_Changed;
- }
- int team = event.GetInt("team");
- if( team == CS_TEAM_T && team == CS_TEAM_CT )
- {
- return Plugin_Changed;
- }
- int client = GetClientOfUserId (event.GetInt("userid"));
- for( int i = 1; i <= MaxClients; i++ )
- {
- if( i == client )
- {
- continue;
- }
- ForcePlayerSuicide(i);
- }
- return Plugin_Changed;
- }
- int RealPlayersCount()
- {
- int count = 0, team = CS_TEAM_NONE;
- for( int i = 1; i <= MaxClients; i++ )
- {
- if( IsFakeClient(i) )
- {
- continue;
- }
- team = GetClientTeam(i);
- if( team == CS_TEAM_T || team == CS_TEAM_CT )
- {
- count++;
- }
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement