MMOMinion

Full Version: GUI_NewCheckbox in Loops?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,
I have a question about GUI_NewCheckbox
if I have a loop, how can I check whether the checkbox is on or off?
The query is stored here in "JD"..k so JD1, JD2, etc.. Unfortunately, you can not define a variable, only a string.

but now I want to let the query run in a loop, since the number of checkboxes are dynamic.


here is an example

PHP Code:
...
for 
1,40 do
  
GUI_NewCheckbox("TestBox","John Do Nr."..k,"JD"..k,"Delete Name")        
end
... 


I tried it with an array, but it does not work Complaint

PHP Code:
...
local JDcheck = {}
for 
1,40 do
  
GUI_NewCheckbox("TestBox","John Do Nr."..k,JDcheck[k],"Delete Name")        
end
... 

thank you
MAHA
if ( _G["JD"..k] == "1" ) then
ahh that's right _G[...]
thank you