SRCDS Steam group

Start with Random Map
Is there any way to start a server with a random map? My current starting script is:
@echo off
echo Protecting srcds from crashes...
echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter.
title Watchdog
echo (%time%) srcds started.
start /wait orangebox\srcds.exe -console -game tf +map phys_toweralpha_3 +maxplayers 24
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds

orangebox\srcds.exe -console -game tf +map phys_toweralpha_3 +maxplayers 24
starts the server and the rest is for crash security. Can anyone tell me if my question is possible?
Nope. The only thing I can thing would be if there was a command to change at random, you can make the server run a script when loaded to change to a random map.
~ Mooga ...w00t? - on Twitter
[Image: 76561197965445574.png]
Please do not PM me for server related help
fqdn Wrote:if you've seen the any of the matrix movies, a game server is not all that different. it runs a version of the game that handles the entire world for each client connected. that's the 2 sentence explanation.
you can change +map (here your map)
I Wrote:Who eat all the donuts.
(09-02-2008, 11:08 AM)Chaosed0 Wrote:  Is there any way to start a server with a random map?...Can anyone tell me if my question is possible?

Yes, it's possible. Check out this code and add it to the top of your starting script after customizing it (see below):


set num=%random%
if /i %num% GTR 34 goto loop
if /i %num% LSS 1 goto loop
goto finish
IF %num%==1 set map=cs_assault
IF %num%==2 set map=cs_atafaris
IF %num%==3 set map=cs_compound
IF %num%==4 set map=cs_havana
IF %num%==5 set map=cs_italy
IF %num%==6 set map=cs_italy_reloaded_final
IF %num%==7 set map=cs_militia
IF %num%==8 set map=cs_office
IF %num%==9 set map=cs_se7en
IF %num%==10 set map=cs_siege_sp
IF %num%==11 set map=de_alivemetal
IF %num%==12 set map=de_aztec
IF %num%==13 set map=de_cbble
IF %num%==14 set map=de_chateau
IF %num%==15 set map=de_csaraa
IF %num%==16 set map=de_dust
IF %num%==17 set map=de_dust2
IF %num%==18 set map=de_dust3
IF %num%==19 set map=de_dust3
IF %num%==20 set map=de_hiekka
IF %num%==21 set map=de_inferno
IF %num%==22 set map=de_losttemple
IF %num%==23 set map=de_nordic_chapel
IF %num%==24 set map=de_nuke
IF %num%==25 set map=de_pasdequartier
IF %num%==26 set map=de_piranesi
IF %num%==27 set map=de_port
IF %num%==28 set map=de_prodigy
IF %num%==29 set map=de_rats
IF %num%==30 set map=de_rio_b1
IF %num%==31 set map=de_tides
IF %num%==32 set map=de_train
IF %num%==33 set map=de_varasto
IF %num%==34 set map=cs_crackhouse

Now, to customize it all you have to do is count how many maps you have on your server and change the number "34" (on the third line of my code) to that number. Then, adjust the if statements to match your maps. You can check "maplist.txt" in your cstrike directory for a list of all your maps.

Finally, make sure to replace the map name with %map% in your starting script. For example, if your starting script contains:

srcds.exe -console -game cstrike +map de_dust -port 27015 -maxplayers 16 -autoupdate

Then you need to change de_dust to %map% so it looks like this:

srcds.exe -console -game cstrike +map %map% -port 27015 -maxplayers 16 -autoupdate

Hope this helps!!

Forum Jump:

Users browsing this thread: 1 Guest(s)