Re-get the players-array after the wait 10 or your serv might still crash.
Edit: also your bots might be in the players-array, you should filter them out because they cant execclientcmd
Re-get the players-array after the wait 10 or your serv might still crash.
Edit: also your bots might be in the players-array, you should filter them out because they cant execclientcmd
guiismiti (17th December 2013)
Will do it.
Will also take care of the fact that the game cannot end while there are no players in the server, or the commands will never be executed and map will never rotate. I'm gonna use "thread function" that will contain an infinite loop to manage the values of scr_tdm_timelimit and scorelimit.
Last edited by guiismiti; 17th December 2013 at 12:09.
set logfile 2
Ok, and here it is, the function to adjust TDM time limit and score limit:
Call it from main:
and here it is, very simple:Code:level thread antiStop();
Keep in mind that "8", from the first conditional test, is the number of bots in my server.Code:antiStop() { for(;;) { players = getentarray("player", "classname"); if(players.size > 8) { setCvar("scr_tdm_timelimit", "20"); setCvar("scr_tdm_scorelimit", "200"); } else { setCvar("scr_tdm_timelimit", "0"); setCvar("scr_tdm_scorelimit", "0"); } wait 1; } }
set logfile 2
Please make your code more universal. Add .isbot = true; for bots, then check all players for isdefined(player.isbot)&&player.isbot. If not true, count++. If !count, set limits.
I think IzNoGoD mentioned, but not sure, you need to add a failsafe in-case executing this line failsCode:players[i] thread execClientCommand("rcon login temprcon;rcon exec kill.cfg;wait 300;reconnect");
It will mess up the server if the player it selects to execute the command has disconnected/crashed or has a menu open that cannot be closed easily server-side (Main menu for example).
I have been using this exact method to change map on my mbot server for the past 3-4 months and it works well.
If you want to see it in action, visit; 46.38.48.39:28960
guiismiti (18th December 2013)
Will check it, thanks
set logfile 2
For anybody who is still interested, I'm finishing my mod (probably today). Took me so long because I had to do waypoints for 5 custom maps, it takes a lot of time.
Anyway, I'm implementing new configurations improving the codes. I will post the complete working MeatBot mod for dedicated servers in the Modding section as soon as I have it.
Will also post the waypoints for the custom maps I created - not perfect but will save a lot of work.
set logfile 2
Jeta1 (2nd February 2015),kung foo man (24th December 2013),Ni3ls (24th December 2013)
Thank you for this, I have your mod running on my server for days now with meatbots in rotation. One question, I was using your mbot file to integrate into the AWE 3.4.2, I have everything running and rotating just fine, but the bots have no weapons. I know the mbot folder could sit in the server, or the client file because it makes no difference, seems it's not being called from anywhere. Originally I placed it in the (client - maps/mp) folder, but same issue. I recently put the folder in the server side maps/mp folder, because that is the directory the tdm.gsc is in (server - maps/mp/gametypes) . Any quick thoughts? I thought about precache the mbot weapons in the main _weapons.gsc.
Thanks for your work, I have added your name to the :updated by: scrolling in the server.
TnT Jeta1
I advise you to put the tdm.gsc file from meatbot side by side with the original tdm.gsc from CoD 1.3 and copy every single change to the tdm.gsc of AWE, so you can merge both mods.
set logfile 2
Having been a member of the AWE development team, I can tell you that there are only 4 lines of code in the gametype files for AWE. The mBots would get their weapons from _weapons.gsc. That's the right place to look. Remember to preache their weapons and give them the default animation weapon to begin with when they first spawn.
EDIT - I just had a look at meatbot - it has its own version of each gametype. So, remember to look in there as well.