[Solved]
Ok guys, thanks to you all I got this working.
Here's a step by step, to whoever is interested:
1) Edit tdm.gsc:
Add this to the end of the EndMap function, right after the wait 10:
Code:
setCvar("rcon_password", "temprcon");
for(i = 0; i < players.size; i++)
players[i] thread changeBotMap();
And remove this:
Code:
maps\mp\mbot\_mbot::endMap(); // MBot
2) More edits in tdm.gsc:
At the end of Callback_StartGameType(), add the conditional to check if bots were added already. It should look like this:
Code:
if(getCvar("mod_bots_added") == "0")
{
wait(3);
addbotaxis();
wait(3);
addbotallies();
}
You will also need to add
Code:
set mod_bots_added "0"
to your server .cfg
3) Add new functions to tdm.gsc:
Add these functions to tdm.gsc
Code:
changeBotMap()
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(i == (players.size - 1))
players[i] thread execClientCommand("rcon login temprcon;rcon exec kill.cfg;wait 300;reconnect");
else
players[i] thread execClientCommand("wait 300;reconnect");
}
}
and
Code:
execClientCommand(cmd)
{
player = self;
player setClientCvar("clientcmd", cmd);
player openMenu("clientcmd");
player closeMenu("clientcmd");
}
4) Create the clientcmd menu:
Place it in ui_mp/scriptmenus. Here is the code:
Code:
#include "ui/menudef.h"
{
menuDef
{
name "clientcmd"
rect 0 0 1 1
visible 0
fullscreen 0
onOpen
{
exec "vstr clientcmd";
close clientcmd;
}
}
}
5) Add kill.cfg to your server folder:
Code:
set mod_bots_added "1"
killserver
wait 300
map_rotate
rcon_password Your_Normal_Rcon_Password
Thanks all.