Forum

> > CS2D > Scripts > menu making need help
Forums overviewCS2D overview Scripts overviewLog in to reply

English menu making need help

9 replies
To the start Previous 1 Next To the start

old menu making need help

EpicCrisis
User Off Offline

Quote
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!

old Re: menu making need help

EpicCrisis
User Off Offline

Quote
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

old Re: menu making need help

Banaan
User Off Offline

Quote
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

old Re: menu making need help

EpicCrisis
User Off Offline

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

old Re: menu making need help

Cure Pikachu
User Off Offline

Quote
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")

old Re: menu making need help

SDKey
User Off Offline

Quote
Hi, Crisis5000, try this script
Spoiler >

old Re: menu making need help

EpicCrisis
User Off Offline

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

old Re: menu making need help

SDKey
User Off Offline

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

Spoiler >
edited 1×, last 15.04.11 12:46:13 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview