resource.AddFile for maps

Hey guys, sorry if this is in the wrong location but I need help.
I need to make players download maps when they join my TTT server, but ONLY when they’re joining that specific map, how do I go around doing this? Thanks in advance.

Don’t resource.AddFile maps. They will automatically download on a current map basis.

is the map on workshop?
you can do this
[lua]
if game.GetMap() == “ttt_awesummap” then
resource.AddWorkshop(“9999999”)
end

– Or you can do this. (If it’s not on workshop)
if game.GetMap() == “ttt_awesummap” then
resource.AddFile(“maps/ttt_awesummap.bsp”)
end

– Or, you can be me and be incredibly lazy. (Again, if it’s not on workshop)
resource.AddFile(“maps/ttt_”…game.GetMap()…".bsp")
[/lua]

[editline]20th July 2014[/editline]

Really? didn’t know that. You can ignore me then unless the map is on workshop.

Always, or only if the server has that map via workshop?

As assigning specific maps to specific workshops files seems unlikely, considering idiots name maps the same and have conflicts / and materials and etc etc.

Only if the server is using FastDL. For AddWorkshop, you must use game.GetMap().

I, just wrote a long reply asking if you was an idiot of I misunderstood…

However I realized the first post said resource.AddFile and I’d read it wrong, I thought he said AddWorkshop and you was claiming it was all automatic. I am a fool ya know.