here something
PHP Code:
public void OnPluginStart()
{
HookEvent("round_start", events);
HookEvent("round_end", events);
HookEvent("bomb_planted", events);
HookEvent("player_death", events);
}
public void events(Event event, const char[] name, bool dontBroadcast)
{
static bool KillBotsAllow = false;
if(StrEqual(name, "player_death", false))
{
bool humans = false;
bool humansalive = false;
for(int i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i) || IsFakeClient(i) || GetClientTeam(i) < 2)
continue;
humans = true;
if(IsPlayerAlive(i))
humansalive = true;
}
if(KillBotsAllow &&
humans &&
!humansalive)
{
PrintToChatAll("[SM] All humans dead, kill bots");
CreateTimer(2.0, delay, .flags=TIMER_FLAG_NO_MAPCHANGE);
}
return;
}
if(StrEqual(name, "round_start", false))
{
KillBotsAllow = true;
return;
}
KillBotsAllow = false;
}
public Action delay(Handle timer)
{
ServerCommand("bot_kill all");
return Plugin_Continue;
}
__________________