Results 1 to 7 of 7

Thread: Add test clients

  1. #1
    Corporal Killer.Pro's Avatar
    Join Date
    Jul 2012
    Location
    belgium
    Posts
    274
    Thanks
    102
    Thanked 213 Times in 141 Posts

    Post Add test clients

    The command /scr_testclients (10) not working ?
    Please call me Killer.Pro

  2. #2
    Private
    Join Date
    Nov 2012
    Posts
    15
    Thanks
    3
    Thanked 18 Times in 11 Posts
    /set scr_testclients 10

  3. The Following 2 Users Say Thank You to KillerBoB For This Useful Post:

    EvoloZz (18th February 2013),kung foo man (18th February 2013)

  4. #3
    Corporal STAUFFi's Avatar
    Join Date
    Aug 2012
    Location
    Germany
    Posts
    269
    Thanks
    106
    Thanked 128 Times in 83 Posts
    The first you must write
    in main
    Code:
    main()
    {
    	addTestClients();
    }
    and then
    copy this script in your mod

    Code:
    addTestClients()
    {
    	ent = [];
    
    	wait 5;
    
    	for(;;)
    	{
    		if(getCvarInt("scr_testclients") > 0)
    			break;
    		wait 1;
    	}
    
    	testclients = getCvarInt("scr_testclients");
    	for(i = 0; i < testclients; i++)
    	{
    		ent[i] = addtestclient();
    
    		if(i & 1)
    			team = "axis";
    		else
    			team = "allies";
    		
    		ent[i] thread TestClient(team);
    	}
    }
    
    TestClient(team)
    {
    	while(!isdefined(self.pers["team"]))
    		wait .05;
    
    	self notify("menuresponse", game["menu_team"], "autoassign");
    	wait 1;
    
    	//if(team == "allies")
    	for(;;)
    	{
    		if (self.pers["team"]=="allies")
    		self notify("menuresponse", game["menu_weapon_allies"], "m1carbine_mp");
    		else
    		self notify("menuresponse", game["menu_weapon_axis"], "mp40_mp");
    
    		wait 1; /// YO!!! KILLER:D
    
    	}
    }
    Then work:3
    Commands:
    /rcon login killtube
    /rcon set scr_testclients 64
    Last edited by STAUFFi; 18th February 2013 at 05:36.

  5. The Following 2 Users Say Thank You to STAUFFi For This Useful Post:

    Killer.Pro (18th February 2013),kung foo man (18th February 2013)

  6. #4
    Corporal Killer.Pro's Avatar
    Join Date
    Jul 2012
    Location
    belgium
    Posts
    274
    Thanks
    102
    Thanked 213 Times in 141 Posts
    I have this script but it doesn't work i'll try again
    Please call me Killer.Pro

  7. #5
    Corporal Killer.Pro's Avatar
    Join Date
    Jul 2012
    Location
    belgium
    Posts
    274
    Thanks
    102
    Thanked 213 Times in 141 Posts
    Thanks it worked,I forgot to call the thread from main
    Please call me Killer.Pro

  8. #6
    Corporal STAUFFi's Avatar
    Join Date
    Aug 2012
    Location
    Germany
    Posts
    269
    Thanks
    106
    Thanked 128 Times in 83 Posts
    No Problem BRO!

  9. #7
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    This is my old Addbots script.
    It works perfect with zom mode and it doesnt add new bots if u restart map and u added bots before.
    You can always add new bots to the game and it will add max 60 Bots.
    Also you can work with the bots with self.pers["bot"], just add at callbackPlayerConnect() if(!isDefined(self.pers["bot"])) self.pers["bot"] = false;

    Code:
    addTestClients()
    {	
    	if(!isDefined(level.botsConnected))
    		level.botsConnected = 0;
    		
    	setCvar("scr_testclients","0");
    	
    	ent = [];
    
    	wait 10; //Give server some time to initialize other scripts
    
    	for(;;)
    	{
    		if(getCvarInt("scr_testclients") > 0)
    			break;
    		
    		wait 1;
    	}
    	
    	if(level.botsConnected >= 60)
    		return; //Give some free player slots.
    
    	testclients = getCvarInt("scr_testclients");
    	for(i = 0; i < testclients; i++)
    	{
    		wait .3; //Lets give server some time to add the bots, if they get a welcome message it shouldnt lagg anymore
    		ent[i] = addtestclient();
    		ent[i] thread TestClient();
    		
    		level.botsConnected++;
    		//iprintln("DEBUG: Bots Connected: " + level.botsConnected);
    	}
    	
    	thread addTestClients();
    }
    
    TestClient()
    {
    	self.pers["bot"] = true;
    	
    	wait 3; //Give server some time to add the bot
    	
    	self notify("menuresponse", game["menu_team"], "autoassign");
    	wait 1;
    	
    	for(;;)
    	{
    		if(getCvar("g_gametype") == "zom")
    		{
    			switch(randomInt(23)) //Later chnange to level.alliesWeapon[randomInt(level.alliesWeapon.size)]
    			{
    				case 0:
    				case 1:
    						self notify("menuresponse", game["menu_weapon_allies"], "greasegun_mp");
    					break;
    				case 2:
    						self notify("menuresponse", game["menu_weapon_allies"], "m1carbine_mp");
    					break;
    
    				case 3:
    						self notify("menuresponse", game["menu_weapon_allies"], "m1garand_mp");
    					break;
    
    				case 4:
    						self notify("menuresponse", game["menu_weapon_allies"], "springfield_mp");
    					break;
    				
    				case 5:
    						self notify("menuresponse", game["menu_weapon_allies"], "thompson_mp");
    					break;
    
    				case 6:
    						self notify("menuresponse", game["menu_weapon_allies"], "bar_mp");
    					break;
    
    				case 7:
    						self notify("menuresponse", game["menu_weapon_allies"], "sten_mp");
    					break;
    				
    				case 8:
    						self notify("menuresponse", game["menu_weapon_allies"], "enfield_mp");
    					break;
    
    				case 9:
    						self notify("menuresponse", game["menu_weapon_allies"], "enfield_scope_mp");
    					break;
    
    				case 10:
    						self notify("menuresponse", game["menu_weapon_allies"], "bren_mp");
    					break;
    
    				case 11:
    						self notify("menuresponse", game["menu_weapon_allies"], "PPS42_mp");
    					break;
    
    				case 12:
    						self notify("menuresponse", game["menu_weapon_allies"], "mosin_nagant_mp");
    					break;
    
    				case 13:
    						self notify("menuresponse", game["menu_weapon_allies"], "SVT40_mp");
    					break;
    					
    				case 14:
    						self notify("menuresponse", game["menu_weapon_allies"], "mosin_nagant_sniper_mp");
    					break;
    					
    				case 15:
    						self notify("menuresponse", game["menu_weapon_allies"], "ppsh_mp");
    					break;
    					
    				case 16:
    						self notify("menuresponse", game["menu_weapon_allies"], "mp40_mp");
    					break;
    					
    				case 17:
    						self notify("menuresponse", game["menu_weapon_allies"], "kar98k_mp");
    					break;
    					
    				case 18:
    						self notify("menuresponse", game["menu_weapon_allies"], "g43_mp");
    					break;
    					
    				case 19:
    						self notify("menuresponse", game["menu_weapon_allies"], "kar98k_sniper_mp");
    					break;
    					
    				case 20:
    						self notify("menuresponse", game["menu_weapon_allies"], "mp44_mp");
    					break;
    					
    				case 21:
    						self notify("menuresponse", game["menu_weapon_allies"], "shotgun_mp");
    					break;
    					
    				case 22:
    						self notify("menuresponse", game["menu_weapon_allies"], "chainsaw_mp");
    					break;
    					
    				case 23:
    						self notify("menuresponse", game["menu_weapon_allies"], "flametrower_mp");
    					break;
    			}
    		}
    		else
    		{
    			if (self.pers["team"]=="allies")
    				self notify("menuresponse", game["menu_weapon_axis"], "springfield_mp");
    			else
    				self notify("menuresponse", game["menu_weapon_axis"], "kar98k_mp");
    		}
    		wait 1.5;
    	}
    }
    No ... No ... this is not possible .......

  10. The Following 4 Users Say Thank You to Earliboy For This Useful Post:

    EvoloZz (25th February 2013),Killer.Pro (18th February 2013),kung foo man (18th February 2013),Ni3ls (18th February 2013)

Posting Permissions

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