This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

plans that are visible only in usermode or touch
#1
It is necessary to make visualization in which can be selected languages.

I created a script but I do not work.

--------------------

-- 1byte object, 0 = RUS, 1 = ENG, 2= LVL
language = event.getvalue()

-- names of plans that are visible only in rus mode
rus_plans_usermode = { 'Главная', 'Языки' }
-- names of plans that are visible only in eng mode
eng_plans_usermode = { 'main'}
-- names of plans that are visible only in lvl mode
lvl_plans_usermode = { 'Galvena'}


-- names of plans that are visible only in rus mode
rus_plans_touch = { 'Главная' }
-- names of plans that are visible only in eng mode
eng_plans_touch = { 'main'}
-- names of plans that are visible only in lvl mode
lvl_plans_touch = { 'Galvena'}


if language==0 then
  rus_plans_usermode, rus_param_touch, eng_plans_usermode, eng_param_touch, lvl_plans_usermode, lvl_param_touch  = '', '', 'H', 'H', 'H', 'H'
end

if language==1 then
  rus_plans_usermode, rus_param_touch, eng_plans_usermode, eng_param_touch, lvl_plans_usermode, lvl_param_touch  = 'H', 'H', '', '', 'H', 'H'
end

if language==2 then
  rus_plans_usermode, rus_param_touch, eng_plans_usermode, eng_param_touch, lvl_plans_usermode, lvl_param_touch  = 'H', 'H', 'H', 'H', '', ''
end


update = { usermode_param = rus_plans_usermode }
for _, name in ipairs(rus_plans_usermode) do
  db:update('visfloors', update, { name = name })
end

update = {touch_param = rus_param_touch }
for _, name in ipairs(rus_param_touch) do
  db:update('visfloors', update, { name = name })
end

update = { usermode_param = eng_plans_usermod}
for _, name in ipairs(eng_plans_usermod) do
  db:update('visfloors', update, { name = name })
end

update = { touch_param = eng_param_touch }
for _, name in ipairs(eng_param_touch) do
  db:update('visfloors', update, { name = name })
end

update = { usermode_param = lvl_plans_usermode}
for _, name in ipairs(lvl_plans_usermode) do
  db:update('visfloors', update, { name = name })
end

update = { touch_param = lvl_param_touch }
for _, name in ipairs(lvl_param_touch) do
  db:update('visfloors', update, { name = name })
end
Reply


Forum Jump: