ertlflorian1 Posted July 12, 2013 Share Posted July 12, 2013 Why it dont work? carhouses = 5 for i=1, carhouses, 1 do "carhousetable"..i.."k" = "blabla" end Link to comment
MIKI785 Posted July 12, 2013 Share Posted July 12, 2013 Because it doesn't make sense? You can't make string have some value O_o Link to comment
ertlflorian1 Posted July 12, 2013 Author Share Posted July 12, 2013 for i=1, carhouses, 1 do "carhousetable"..i.."k" = {} end Link to comment
bandi94 Posted July 12, 2013 Share Posted July 12, 2013 for i=1, carhouses, 1 do "carhousetable"..i.."k" = {} end local carhouses=5 local carhousetable={} for i=1, carhouses, 1 do carhousetable[i]="blabla" end Link to comment
ertlflorian1 Posted July 12, 2013 Author Share Posted July 12, 2013 no i want to create 15 (carhouses value) tables: carhousetable1k carhousetable2k carhousetable3k carhousetable4k carhousetable5k ... Link to comment
bandi94 Posted July 12, 2013 Share Posted July 12, 2013 no i want to create 15 (carhouses value) tables:carhousetable1k carhousetable2k carhousetable3k carhousetable4k carhousetable5k ... Make it by hand , there is no other way to create tabel's. Link to comment
ertlflorian1 Posted July 12, 2013 Author Share Posted July 12, 2013 carhouses is an value which I get from an Mysql database index Link to comment
ertlflorian1 Posted July 12, 2013 Author Share Posted July 12, 2013 Thats the function how I get carhouses: carhouses = 0 local query = dbQuery ( handler, "SELECT * FROM carhouse_names") for i, row in pairs (dbPoll(query, -1)) do setElementData (root, "house"..row.ID, row.Name) carhouses = carhouses + 1 end Link to comment
bandi94 Posted July 12, 2013 Share Posted July 12, 2013 Ok and after do you want to store the carhouses position in tabel's or what to do with them bk i dont get it. Link to comment
ertlflorian1 Posted July 12, 2013 Author Share Posted July 12, 2013 For every carhouse there would be createt an table where the names of the cars which you can buy in the carhouse are written Link to comment
bandi94 Posted July 12, 2013 Share Posted July 12, 2013 For every carhouse there would be createt an table where the names of the cars which you can buy in the carhouse are written Let's try it with ElementData it offers more work space something like. local ElementTable={} for i=1, carhouses, 1 do local carhouse = createElement("car_house") ElementTable[i]=carhouse end Then something like for i=1, carhouses, 1 do for car=1, cars, 1 do local name = "car"..i.."" setElementData( ElementTable[i],name,car_name_table[j]) end end Link to comment
Cadu12 Posted July 12, 2013 Share Posted July 12, 2013 carhouses = 5 for i=1, carhouses, 1 do _G["carhousetable"..i.."k"] = "blabla" end outputChatBox(carhousetable1k) Not tested yet. 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