For some reason players are missing maps but I added a file to download them. Anyone know whats up?
Here is the file I put in lua/autorun/server
[CODE]local maps = {
[ "ttt_minecraft_b5" ] = 159321088, -- WorkshopID here
[ "ttt_rooftops_a2_f1" ] = 253328325,
[ "ttt_olivegarden" ] = 271298077,
[ "ttt_lttp_kakariko_a4" ] = 118937144,
[ "ttt_bb_teenroom_b2" ] = 141103402,
[ "ttt_castle_2011_v3_day" ] = 284613981,
[ "ttt_old_factory" ] = 196978840,
[ "ttt_forest_final" ] = 147635981,
}
resource.AddWorkshop( maps[ game.GetMap() ] )[/CODE]
pretty sure the number needs to be in quotes.
Why not just put this:
[CODE]
resource.AddSingleFile("map_name1.bsp")
resource.AddSingleFile("map_name2.bsp")
[/CODE]
[QUOTE=OptimalVorteX;45430364]Why not just put this:
[CODE]
resource.AddSingleFile("map_name1.bsp")
resource.AddSingleFile("map_name2.bsp")
[/CODE][/QUOTE]
Some people prefer workshop for whatever reason.
[QUOTE=StonedPenguin;45430028]pretty sure the number needs to be in quotes.[/QUOTE]
I did that and it still says missing map.
[editline]18th July 2014[/editline]
[QUOTE=OptimalVorteX;45430364]Why not just put this:
[CODE]
resource.AddSingleFile("map_name1.bsp")
resource.AddSingleFile("map_name2.bsp")
[/CODE][/QUOTE]
I force download from the workshop
[QUOTE=TheHidden;45429802]For some reason players are missing maps but I added a file to download them. Anyone know whats up?
Here is the file I put in lua/autorun/server
[CODE]local maps = {
[ "ttt_minecraft_b5" ] = 159321088, -- WorkshopID here
[ "ttt_rooftops_a2_f1" ] = 253328325,
[ "ttt_olivegarden" ] = 271298077,
[ "ttt_lttp_kakariko_a4" ] = 118937144,
[ "ttt_bb_teenroom_b2" ] = 141103402,
[ "ttt_castle_2011_v3_day" ] = 284613981,
[ "ttt_old_factory" ] = 196978840,
[ "ttt_forest_final" ] = 147635981,
}
resource.AddWorkshop( maps[ game.GetMap() ] )[/CODE][/QUOTE]
Try
[code]resource.AddWorkshop( tostring( maps[ game.GetMap() ] ) )[/code]
[QUOTE=TheHidden;45430576]Still didnt work.[/QUOTE]
For this I will assume you are using the steam workshop to download you maps and addons. Firstly you need to get a steam API key by going here; [url]http://steamcommunity.com/dev/apikey[/url] . You then have to make a collection of maps on the steam workshop (Google it if you dont know how). After you have done that you need to go to /lua/autorun/server and create a file called workshop.lua, in this file you need to paste the id's of the maps like this;
resource.AddWorkshop ("275415753")
resource.AddWorkshop ("287966771")
resource.AddWorkshop ("200700693")
Change the numbers to the id's of your maps.
After this you need to edit the start.bat of your server to look like this (this is part of my one);
start /wait srcds.exe -console -game garrysmod +map fm_escape +maxplayers 23 +gamemode floodmod +authkey B7B549*************************** +host_workshop_collection 287887179
after +authkey you need to delete my key and place the API key you got earlier
after +host_workshop_collection you need to paste your workshop collection id.
It should now all work.
If you do that it'll force the client to download every map and any other workshop addon when they first join.
What he wants is the current map to be downloaded and no other.
Oh
Print out the game.GetMap( ); the reason the maps array may not be working is because the filename may be xX_MaP instead of xx_map. use string.lower( game.GetMap( ) )
Sorry, you need to Log In to post a reply to this thread.