#include <sourcemod>#include <sdktools>#include <cstrike>public void EventSpawn(Handle event, char[] name, bool dbc){ if(GetAlivePlayers() < 3) return; UnhookEvent("player_spawn", EventSpawn) if(GetAlivePlayers(2) > 1) { for(int i = 1; i <= 64 ; i++){ if(IsClientInGame(i) && GetClientTeam(i) == 2) { ForcePlayerSuicide(i); break; } } } else if(GetAlivePlayers(3) > 1) { for(int i = 1; i <= 64 ; i++){ if(IsClientInGame(i) && GetClientTeam(i) == 3) { ForcePlayerSuicide(i); break; } } }}public void OnMapStart(){ HookEvent("player_spawn", EventSpawn)}int GetAlivePlayers(int team = 0){ int alives = 0 for(int i = 1; i<=64; i++) { if(IsClientInGame(i) && GetClientTeam(i) > 1 && IsPlayerAlive(i) && ((team != 0) == (GetClientTeam(i) == team))) alives++ } return alives}
#include <sourcemod>#include <sdktools>#include <cstrike>bool restart = truepublic void OnPluginStart(){ HookEvent("player_spawn", EventSpawn)}public void EventSpawn(Handle event, char[] name, bool dbc){ if(!restart) return if(GetAlivePlayers() < 3) return; restart = false if(GetAlivePlayers(2) > 1) { for(int i = 1; i <= 64 ; i++){ if(IsClientInGame(i) && GetClientTeam(i) == 2) { ForcePlayerSuicide(i); break; } } } else if(GetAlivePlayers(3) > 1) { for(int i = 1; i <= 64 ; i++){ if(IsClientInGame(i) && GetClientTeam(i) == 3) { ForcePlayerSuicide(i); break; } } }}public void OnMapStart(){ restart = true}int GetAlivePlayers(int team = 0){ int alives = 0 for(int i = 1; i<=64; i++) { if(IsClientInGame(i) && GetClientTeam(i) > 1 && IsPlayerAlive(i) && ((team != 0) == (GetClientTeam(i) == team))) alives++ } return alives}