Jump to content

Table for few labels


Piorun

Recommended Posts

Hi everyone.

I've got one question.

How to create a table for a function witch i create more than 1 label. For ex. I created a function where i have mysql result who returns a more than 1 rows. So my code in client-side:

  
function blablabla(row1, row2) 
guiCreateLabel(0,0,100,10, row1.." "..row2, false) 
end 
  

I want this code be able with table for ex.

  
function blablabla(row1, row2) 
labels = {} 
labels[1,2,3...] = guiCreateLabel(0,0,100,10, row1.." "..row2, false) 
end 
  

How?

Link to comment
  
function blablabla(row1, row2) 
      lbl1 = guiCreateLabel(0,0,100,10, row1.." "..row2, false) 
      lbl2 = guiCreateLabel(0,0,100,10, row1.." "..row2, false) 
      lbl3 = guiCreateLabel(0,0,100,10, row1.." "..row2, false) 
      labels = { 
       lbl1, 
       lbl2, 
       lbl3, 
      } 
end 
  

to hide all lables you can use

  
for k,v in ipairs(labels) do 
      guiSetVisible(v,false) 
end 
  

or if you want hide 1 label use

  
      guiSetVisible(labels[1],false) 
  

Link to comment

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