Negriukas Posted October 2, 2014 Share Posted October 2, 2014 Hi, Is it possible to get all a specified folder files and insert them in a table with 3 arguments, {'file type(txd,dff,col)', 'path', id} I'm working on a HTTP Mod Loader and too lazy to spam over and over and over Link to comment
King12 Posted October 2, 2014 Share Posted October 2, 2014 I think it's possible f.e : local vModLoader = { { 'txd','cars/infernus.txd','411'}, { 'dff','cars/infernus.dff','411'}, { 'dff','cars/hunter.dff','425'} } for index,value in ipairs ( vCommandLoader ) do outputChatBox (value[ 3 ],source,255,255,255,true ) -- This will output the 3rd value into the chat. Link to comment
Negriukas Posted October 2, 2014 Author Share Posted October 2, 2014 I think it's possible f.e : local vModLoader = { { 'txd','cars/infernus.txd','411'}, { 'dff','cars/infernus.dff','411'}, { 'dff','cars/hunter.dff','425'} } That's what i meant by 'spamming over and over', and it wont help Link to comment
King12 Posted October 2, 2014 Share Posted October 2, 2014 (edited) I think it's possible f.e : local vModLoader = { { 'txd','cars/infernus.txd','411'}, { 'dff','cars/infernus.dff','411'}, { 'dff','cars/hunter.dff','425'} } That's what i meant by 'spamming over and over', and it wont help How do you want it then? Like this? local cars = { filePath = "txd/", txdFiles = {425,411,214}, ids = {425,411,214}, } function () for i,value in pairs(cars.txdFiles) do local txd = engineLoadTXD ( cars.filePath..value..".txd" ) for i,value1 in pairs(cars.ids) do engineImportTXD ( txd, value1 ) end It must have alot of debugs problems, but I'm just trying to get your idea. Let's say i have 20 mod in a folder, txd and dff, which makes them 40 file, I have to spam { 'txd','cars/infernus.txd','411'}, { 'dff','cars/infernus.dff','411'}, { 'txd','cars/name.txd','id'}, { 'dff','cars/name.txd','id'}, { 'txd','cars/name.txd','id'}, { 'dff','cars/name.txd','id'}, all the time? Is there any to get automatically the files from 'cars' folder and insert in a table etc... I don't know actually, but mine could be helpful and less spam. Edit : I searched for a script and I found this example : for i = 0, 3 do local tex = dxCreateTexture ( "stopbord/right/rframe"..i..".png" ) 0, 3 will be the files name. Edited October 2, 2014 by Guest Link to comment
Negriukas Posted October 2, 2014 Author Share Posted October 2, 2014 Let's say i have 20 mod in a folder, txd and dff, which makes them 40 file, I have to spam { 'txd','cars/infernus.txd','411'}, { 'dff','cars/infernus.dff','411'}, { 'txd','cars/name.txd','id'}, { 'dff','cars/name.txd','id'}, { 'txd','cars/name.txd','id'}, { 'dff','cars/name.txd','id'}, all the time? Is there any to get automatically the files from 'cars' folder and insert in a table etc... Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now