Results 1 to 10 of 65

Thread: Changing map on MeatBot (CoD 2)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Quote Originally Posted by vanfreddy View Post
    hi
    look here http://www.modsonline.com/Forums-top-156329.html the post from
    Dobriy is a good basic to start and need no third party

    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.
    Last edited by guiismiti; 13th December 2013 at 12:41.
    set logfile 2

  2. The Following User Says Thank You to guiismiti For This Useful Post:

    kung foo man (13th December 2013)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •