• Resource FAST DL Problem
    2 replies, posted
Ok, i got a problem where the server FAST DL Will make users download every single map that is on the FASTDL server, and not just the specific map that the game server is currently running. Is there a way to fix this. I only use my FastDL server for maps. I'll also just place my resources.lua to help. [CODE]--[[ Create recursive add file function ]]-- local function AddDir(dir) --recursively adds everything in a directory to be downloaded by client local files, folders = file.Find(dir.."/*", "GAME") for _, fdir in pairs(folders) do if fdir != ".svn" then // don't spam people with useless .svn folders AddDir(dir.."/"..fdir) end end for k,v in pairs(files) do resource.AddFile(dir.."/"..v) end end --[[ Add directory containing multiple files below using " AddDir("") " ]]-- resource.AddFile("maps/ttt_skyscraper_2015_v1gf.bsp") resource.AddFile("maps/gm_house3v3.bsp") resource.AddFile("maps/md_clue.bsp")[/CODE]
This'll work much better. [Code] --[[ Map Content ]]-- -- Efficient Map Resource Downloads local mapName = game.GetMap() local workshopMaps = { ["ph_restaurant"] = "186139871", ["ph_warehousev2"] = "177889282", ["ph_islandhouse"] = "237152021", ["ph_parkinglot"] = "277737958" } if workshopMaps[mapName] then resource.AddWorkshop(workshopMaps[mapName]) else resource.AddFile("maps/" .. mapName .. ".bsp") end [/Code] You could alternatively use this. [Code] if game.GetMap() == "rp_downtown_aurora_v2" then resource.AddWorkshop("451967299") -- Aurorav2 end [/Code]
[QUOTE=BanLorenzo;47950315]This'll work much better. [Code] --[[ Map Content ]]-- -- Efficient Map Resource Downloads local mapName = game.GetMap() local workshopMaps = { ["ph_restaurant"] = "186139871", ["ph_warehousev2"] = "177889282", ["ph_islandhouse"] = "237152021", ["ph_parkinglot"] = "277737958" } if workshopMaps[mapName] then resource.AddWorkshop(workshopMaps[mapName]) else resource.AddFile("maps/" .. mapName .. ".bsp") end [/Code] You could alternatively use this. [Code] if game.GetMap() == "rp_downtown_aurora_v2" then resource.AddWorkshop("451967299") -- Aurorav2 end [/Code][/QUOTE] Thank You so much for this, it worked very well! =D
Sorry, you need to Log In to post a reply to this thread.