Forum

> > CS2D > Scripts > Load maps in a lua Menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English Load maps in a lua Menu

7 replies
To the start Previous 1 Next To the start

old Load maps in a lua Menu

DragonAwper
User Off Offline

Quote
Script that loads all maps that i have in
map folder (cs2d/maps/) in a menu

i tried to made but i don't know how to list the names in a menu

1.Is it possible?
2.How to Make it?

Thanks a lot.

old Re: Load maps in a lua Menu

Yates
Reviewer Off Offline

Quote
Oh. Wait, am I reading this correctly now? He wants a lua that checks all his maps and puts them into a menu?!

old Re: Load maps in a lua Menu

Apache uwu
User Off Offline

Quote
Here you go. Organizing from table/array to menu/gui is up to you.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
os.execute('dir "maps" > tmp') --windows
os.execute('ls -a1 "maps" > tmpmap') --unix

maps={}
for file in io.lines("tmp") do
	if file:sub(-4) == ".map" then
		table.insert(maps,string.sub(file,40,-5))
	end
end

os.execute('del tmp') --windows
os.execute('rm tmp') --unix

for _,map in ipairs(maps) do
	msg(map) --showing that it works
end

old Re: Load maps in a lua Menu

Apache uwu
User Off Offline

Quote
So you want to list a large number of items and have a less and more button to navigate through the items? Your last post was really bad at explaining that.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview