Code:
/*CS/CZ restart round mono-to-duo, Idea by: MeliMeli*/
#include amxmodx
#define PLUGIN "Restarting Round"
#define VERSION "1.0.3"
#define AUTHOR "SPiNX"
#define MAX_PLAYERS 32
new g_zombies
new bool:bRestarted, Xcvar_bot;
new bool:bBot[MAX_PLAYERS +1];
new const SzCMD[]="sv_restartround 2"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
Xcvar_bot=register_cvar("mp_two_bot", "1")
/*Zombie leave as 1 to fix round to include bots.*/
}
public client_putinserver(id)
{
bBot[id] = is_user_bot(id) ? true : false
if(bBot[id] && get_pcvar_num(Xcvar_bot) || !bBot[id] && !get_pcvar_num(Xcvar_bot))
{
g_zombies++
if(g_zombies == 2 && !bRestarted)
{
bRestarted = true
console_cmd( 0, SzCMD )
console_cmd( 0, "say ^"%s, %s by %s.^"", PLUGIN, VERSION, AUTHOR )
}
}
}
public client_disconnected(id)
{
if(bBot[id] && get_pcvar_num(Xcvar_bot) || !bBot[id] && !get_pcvar_num(Xcvar_bot))
{
g_zombies--
if(g_zombies < 2 && bRestarted)
bRestarted = false
}
}
__________________