Jump to content

string problem


Recommended Posts

Posted
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 
  
  
  

Posted
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.

Posted

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 

Posted
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 
  
  

Posted
carhouses = 5 
for i=1, carhouses, 1 do 
    _G["carhousetable"..i.."k"] = "blabla" 
end 
  
outputChatBox(carhousetable1k) 

Not tested yet.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...