• Custom Files on my server
    13 replies, posted
Well, I have started a DarkRP 2.1.4 server 2 days ago, and like, many people can't download things (some wiremod things they see errors or pink and black ropes). I have also tried to make a batman class, I have the custom texture, and me and my friends can see the model (we had the shit for the model beforehand) while everyone else sees a big moving ERROR. I dunno if it's my server hoster (xenonservers) or I'm doing something wrong. Please help D:
You need to set up a lua file with file paths. Hopefully someone will be able to tell you more. Something like resource.addFile(S)
[QUOTE=whosdr;24090490]You need to set up a lua file with file paths. Hopefully someone will be able to tell you more. Something like resource.addFile(S)[/QUOTE] Do you know anyone/ have a link that will help me with this? I don't have any friends that are into lua ><
/bump Please, I really need help with this D:
ok this is easy. in your /lua/autorun/server dir put a file (any name), but normally resources.lua In that file you are going to want to put in it something like this. [lua] resource.AddFile("/lua/hudurr.lua" resource.Addfile("/models/my models/robit") [/lua] and then restart the server. Should work.
[QUOTE=Insanehl;24096418]ok this is easy. in your /lua/autorun/server dir put a file (any name), but normally resources.lua In that file you are going to want to put in it something like this. [lua] resource.AddFile("/lua/hudurr.lua" resource.Addfile("/models/my models/robit") [/lua] and then restart the server. Should work.[/QUOTE] Thank you so much, I was hitting myself over the head trying to figure this out BTW, do I just do one file at a time or can I add whole folders (like pcmod) because I have like 500 files I need to add ><
[QUOTE=AoS.Cameron;24098595]Thank you so much, I was hitting myself over the head trying to figure this out BTW, do I just do one file at a time or can I add whole folders (like pcmod) because I have like 500 files I need to add ><[/QUOTE] addir?
[QUOTE=blown25;24098655]addir?[/QUOTE] What do you mean? Like the dir to the single folder?
Ok for a dir (directory) use this [lua] function AddDir(dir) local list = file.FindDir("../"..dir.."/*") for _, fdir in pairs(list) do if fdir != ".svn" then AddDir(dir.."/"..fdir) end end for k,v in pairs(file.Find("../"..dir.."/*")) do resource.AddFile(dir.."/"..v) end end AddDir("materials/my materials") [/lua] Should work. BROTIP: DO NOT ADD A DIR WITH LIKE 3000 MODELS. LIKE PHX, NO ONE WANTS TO DOWNLOAD IT BEFORE THEY PLAY.
[QUOTE=Insanehl;24098999]Ok for a dir (directory) use this [lua] function AddDir(dir) local list = file.FindDir("../"..dir.."/*") for _, fdir in pairs(list) do if fdir != ".svn" then AddDir(dir.."/"..fdir) end end for k,v in pairs(file.Find("../"..dir.."/*")) do resource.AddFile(dir.."/"..v) end end AddDir("materials/my materials") [/lua] Should work. BROTIP: DO NOT ADD A DIR WITH LIKE 3000 MODELS. LIKE PHX, NO ONE WANTS TO DOWNLOAD IT BEFORE THEY PLAY.[/QUOTE] Is this for folders?
Yes, in most cases they are refereed to as directories.
[QUOTE=Insanehl;24099253]Yes, in most cases they are refereed to as directories.[/QUOTE] I tried adding batman (/gamemodes/DarkRP/content/materials/models/player/slow/jamis/mkvsdcu/batman) but my friend said he got the error again :\. Am I doing something wrong? Here is what I did in my resources.lua: [lua]function AddDir(dir) local list = file.FindDir("../"..dir.."/*") for _, fdir in pairs(list) do if fdir != ".svn" then AddDir(dir.."/"..fdir) end end for k,v in pairs(file.Find("../"..dir.."/*")) do resource.AddFile(dir.."/"..v) end end AddDir("/gamemodes/DarkRP/content/materials/models/player/slow/jamis/mkvsdcu/batman")[/lua]
Ok, first off for the downloading on you server you might want to play the thing to download in just the materials, models, sounds, ect. directories. and when you do that you will need to change the dirs respectively, well if you are using FastDL. And the error is coming from not having a model. You have a material folder defined there.
[QUOTE=Insanehl;24099417]Ok, first off for the downloading on you server you might want to play the thing to download in just the materials, models, sounds, ect. directories. and when you do that you will need to change the dirs respectively, well if you are using FastDL. And the error is coming from not having a model. You have a material folder defined there.[/QUOTE] [lua]function AddDir(dir) local list = file.FindDir("../"..dir.."/*") for _, fdir in pairs(list) do if fdir != ".svn" then AddDir(dir.."/"..fdir) end end for k,v in pairs(file.Find("../"..dir.."/*")) do resource.AddFile(dir.."/"..v) end end AddDir("/gamemodes/DarkRP/content")[/lua] It still won't work... Here is my Steam if you want to help me through it since I can't really do this through a thread: aoscameron
Sorry, you need to Log In to post a reply to this thread.