Results 1 to 10 of 65

Thread: Changing map on MeatBot (CoD 2)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    [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.
    Last edited by guiismiti; 17th December 2013 at 06:08.
    set logfile 2

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

    Ni3ls (17th 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
  •