Help me , its sooo sooo important that i can't use the menu with wrong time , i need it now , please help me as u want
Forum
CS2D Scripts How i create a menuHow i create a menu
3 replies 1
Help me , its sooo sooo important that i can't use the menu with wrong time , i need it now , please help me as u want
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
addhook('serveraction','serveraction_buymenu') function serveraction_buymenu(id,act) -- function 1 if act==1 then menu(id,'Buy Guns,Weapons,Buy HP,More HP') end end function menu_buymenu(id,title,buton) -- function 2 if title=='Buy Guns' then if buton==1 then menu(id,'Weapon,Deagle|$500,M3|$1500,M4A1|$3000,AWP|$4000') -- The guns end end if title=='Weapon' then if buton==1 then if player(id,'money')>=500 then parse('setmoney '..id..' '..player(id,'money')-500) -- Costs parse('equip '..id..' 3') parse('setweapon '..id..' 3') else msg('©255000000Not enough money!@C') -- Not enough money end 	end end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("serveraction","sv_a") function sv_a(id,b) -- ID of player and button pressed 	if b == 1 then 		menu(id,"Called Menu,button 1,button 2") 	else 		menu(id,"Called Menu,button 1,button 2") 	end end addhook("menu","c_m") function c_m(id,t,b) -- ID of player, title of menu, which button is pressed 	if t == "Called Menu" then 		if b == 1 			msg("Player with ID "..id.." pressed menu with title ' "..t.." ' button "..b) 		end 	end end
This one should work. AND it you should notice how menu is created and how it's called.
@ alex72super: You forgot to enclose an "if"
@ Rainoth: Thanks your menu is so cool , i give you a big thanks , you and 72super
1