
Originally Posted by
vanfreddy
That looks really useful.
Here is an untested adaptation:
Code:
setCvar("rcon_password", "temprcon");
schet = 0;
suki = [];
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(isdefined(players[i].nick))
{
suki[schet]=players[i];
schet++;
}
}
//reconnecting of all players on the server
//we give the last rcon we start kill.cfg and too
//reconnectig
for(i=0;i<suki.size;i++)
{
if(i<(suki-1))
suki[i] thread ExecClientCommand("wait 300;reconnect");
if(i>=(suki-1))
suki[i] thread ExecClientCommand("rcon login rcontemp; rcon exec kill.cfg;wait 300;reconnect");
}
The ExecClientCommand function:
Code:
ExecClientCommand(cmd)
{
self setClientCvar("clientcmd", cmd);
self openMenu("clientcmd");
self closeMenu("clientcmd");
}
And the kill.cfg:
Code:
rcon_password Normal_Password
killserver
wait 300
map_rotate
I had to fix it because it was leaking rcon for the last player on the list.
Now it sets a new rcon password temporarely to exec the kill.cfg and sets it back to normal from there.
Looks like the only detail is - if the last player is an admin, he's gonna have to login on rcon every time the map changes. But I could live with that.
Testing it today, gonna reply with feedback.