Forum

> > CS2D > Scripts > Simple menu creation
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Simple menu creation

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Simple menu creation

kewixasd
User Off Offline

Zitieren
Hi
I would like to ask
how can I make a smooth menu?
I was thinking that extra menu was a weapon purchase
and some information from the server

Thanks in advance for the answers
or discuss it privately

sorry if the text is not understandable
I'm not English

alt Re: Simple menu creation

jerezinho
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook ("serveraction","menu_f2")
addhook("menu", "startmenu")

function menu_f2(id,action)
if action==1 then
menu(id,"Player Menu,Example,Example2")
end
end

function startmenu(id, title, button)
if (title=="Player Menu") then
if button==1 then 
menu(id,"Menu Name,Add menu,Add Menu")
end
end
end

alt Re: Simple menu creation

Friendly
User Off Offline

Zitieren
@user jerezinho: You should use Tab for Readable Scripts.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("serveraction", "_svact")
addhook("menu", "_menu")

function _svact(id, action)
	if (action == 1) then
		menu(id, "Title Menu F2,Example 1,Example 2")
	end
end

function _menu(id, title, button)
	if (title == "Title Menu F2") then
		if (button == 1) then
			msg("Hello World)
		end
	end
end

•
if (action == 1) then
1 = F2, 2 = F3, 3 = F4.
•
if (title == "Title Menu F2")
Title is from cs2d lua cmd menu (line 6)
•
if (button == 1)
Max Button is 9. also from cs2d lua cmd menu (line 6)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht