Forum

> > CS2D > Scripts > menu making need help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch menu making need help

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt menu making need help

EpicCrisis
User Off Offline

Zitieren
This is my first time scripting and I'm don't know how to make a menu, when you press the 'next' button and then the other menu will pop out. In samples there is no guide of it. Please help!

alt Re: menu making need help

EpicCrisis
User Off Offline

Zitieren
I mean in the script when you press 'next' and the second menu will come out and I don't know how to do it. When I press 'next' in the menu I made it won't come out.

Heres what I did so far on the lua script.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
addhook("menu","sample.classes.menu")
function sample.classes.menu(id,menu,sel)
	if (menu=="Select your Class#1") then
		if (sel>=0 and sel<=8) then
			sample.classes.class[id]=sel
			if (player(id,"health")>0) then
				parse("killplayer "..id)				
			end
		elseif (sel>=9) then
			menu(id,"Select your Class#2:Tank,Zombie,Commando")
		end
	end
	if (menu=="Select your Class#2") then
		if (sel>=0 and sel<=3) then
			sample.classes.class[id]=sel+9
			if (player(id,"health")>0) then
				parse("killplayer "..id)				
			end
		end
	end
end

1
2
3
4
sample.classes.class=initArray(32)
function sample.classes.classmenu(id)
	menu(id,"Select your Class,Random,Soldier,Ghost,Engineer,Pyro,Scout,Sniper,Bomber,Next")	
end

alt Re: menu making need help

Banaan
User Off Offline

Zitieren
The menu you create has the title Select your Class:
1
menu(id,"Select your Class,Random,Soldier,Ghost,Engineer,Pyro,Scout,Sniper,Bomber,Next")

You check for the title Select your Class#1 in your function:
1
if (menu=="Select your Class#1") then

alt Re: menu making need help

EpicCrisis
User Off Offline

Zitieren
I don't mean that actually, I mean when you press 'next' the second menu will appear, could anyone give me a sample?

alt Re: menu making need help

Cure Pikachu
User Off Offline

Zitieren
You did a sample already.
I'll give you a fix. Replace
1
menu(id,"Select your Class#2:Tank,Zombie,Commando")
with
1
menu(id,"Select your Class#2,Tank,Zombie,Commando")

alt Re: menu making need help

SDKey
User Off Offline

Zitieren
Hi, Crisis5000, try this script
Spoiler >

alt Re: menu making need help

EpicCrisis
User Off Offline

Zitieren
Thanks!!! The only thing screwing it up is the 'comma' in the script. Thanks again for everyone that helped.
cookiecookies for everyone!!!

alt Re: menu making need help

SDKey
User Off Offline

Zitieren
Hmm, in my menu system your script will look so:

Spoiler >
1× editiert, zuletzt 15.04.11 12:46:13
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht