Forum

> > CS2D > Scripts > About menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English About menu

10 replies
To the start Previous 1 Next To the start

old About menu

Mora
User Off Offline

Quote
Hello
I just need know,where i can search it:
i have menu: when i press button,then this button i can press again,only when time out(30 sec)...BUTTON,not MENU!
ex:
Magic <name menu
magic spear <-when press,then block in 30 sec(and time 30,29,28,27 etc)
where i can search it?
Thanks you

sorry my english :<
edited 1×, last 18.10.13 01:42:27 pm

old Re: About menu

Rainoth
Moderator Off Offline

Quote
Did I understand this correctly :

You press F2-F4/E and you get a menu which does something. You can't open menu again once it's closed, right ?

old Re: About menu

alex72super
User Off Offline

Quote
user Rainoth has written
Did I understand this correctly :

You press F2-F4/E and you get a menu which does something. You can't open menu again once it's closed, right ?


He wants a menu,

when you press a button in it it closes for 30 sec. (the button cannot be pressed again for 30 sec.)

old Re: About menu

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
a = {}

addhook("join","e")
function e(id)
a[id]=0
end

addhook("serveraction","b")
function b(id)
	if a[id]~=1 then
		menu(id,"potato,supah magic spear and stuff...|15 sec")
	else
		menu(id,"potato,(supah magic spear and stuff...|15 sec)")
	end
end

addhook("menu","c")
function c(id,tit,butt)
	if tit=="potato" then
		if butt==1 then
			a[id]=1
			parse("equip "..id.." 47")
			timer(30000,"parse","lua a["..id.."]=0")
		end
	end
end

They'll be able to open menu but it won't work. Soz I'm doing maths homework and my brain melted so I can't help any better right now.

P.S. Replace "parse("equip" etc. etc. part with whatever your magic spear is.
edited 3×, last 18.10.13 03:37:00 pm

old Re: About menu

Mora
User Off Offline

Quote
LUA ERROR: [string "a[id]=0"]:1: table index is nil
i need know where you got it.
And one:when i press button,then button block in 30 sec,but not menu.
and button will be like this
menu(id,"Magic,magic spear,blahblah")

i press "magic spear" and menu will be
menu(id,"Magic,(magic spear| =Here timer 30 sec=),blalbla")

old Re: About menu

Rainoth
Moderator Off Offline

Quote
Try again.
And it's not possible to have a changing number to show cooldown. Unless you call a menu every second.

old Re: About menu

Mora
User Off Offline

Quote
eh i wrong...
button block,without timer,just this button i cant press(15sec)...

it just will be
menu(id,"Magic,spear|15 sec,blah")
when press button:
menu(id,"Magic,(spear|15sec),blahblah")
15 sec left... again menu with button:
menu(id,"Magic,spear|15 sec,blah")

IMG:https://i.pixs.ru/storage/6/9/2/1bmp_4596796_9418692.jpg


IMG:https://i.pixs.ru/storage/7/0/3/2bmp_9396218_9418703.jpg
edited 1×, last 18.10.13 03:17:48 pm

old Re: About menu

Rainoth
Moderator Off Offline

Quote
Changed so it turns off if spear is unavailable. Good ?

old Re: About menu

Mora
User Off Offline

Quote
after pressing the button spear this button is blocked,but the menu can be opened,only to press the button spear press will be possible only after 15 seconds.

:translate: maybe so you can understeand,because all cant understeand my very bad english

old Re: About menu

Avo
User Off Offline

Quote
user Avoie to the rescue!

Code >

old Re: About menu

Mora
User Off Offline

Quote
@user Avo: it can be easy than your code?i will learn it =O.Where you got it?

what about array?where i can got it?


Thank you so much @user Avo: ! you super puper
edited 2×, last 19.10.13 12:38:21 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview