Forum

> > CS2D > Scripts > Menu button equal 0
Forums overviewCS2D overview Scripts overviewLog in to reply

English Menu button equal 0

4 replies
To the start Previous 1 Next To the start

old Menu button equal 0

tontonEd
User Off Offline

Quote
I've got a very specific problem,
when a player click on the cancel or the cross then on menuhook button equals 0.
so, I want everytime someone click on cross/cancel button, that a new menu appears.
it work fine with the cancel button but not with the cross.
any explanations? (a way to make it work?)


1
2
3
4
5
6
7
8
9
10
11
12
addhook("menu","onMenu")
function onMenu(id,title,button)
	parse("msg "..button)
	if button==0 then
		parse("msg okok")
		menu(1,"MENU TWO,Button 1,Button 2,Button 3")
	end
end
addhook("startround","onStartround")
function onStartround(mode)
	menu(1,"Big Menu With 3 Buttons@b,Button 1,Button 2,Button 3")
end

old Re: Menu button equal 0

Apache uwu
User Off Offline

Quote
It only works if I add a delay:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("menu","onMenu")
function onMenu(id,title,button)
     parse("msg "..button)
     if button==0 then
          parse("msg okok")
          timer(0, "test")
     end
end

function test()
    menu(1,"MENU TWO,Button 1,Button 2,Button 3")
end

addhook("startround","onStartround")
function onStartround(mode)
     menu(1,"Big Menu With 3 Buttons@b,Button 1,Button 2,Button 3")
end

old Re: Menu button equal 0

tontonEd
User Off Offline

Quote
@user _Yank:
Quote
0 for cancel and X (closing)

yes, it confused me also, but X here is the symbol of the closing button.
both return 0
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview