Forum

> > CS2D > Scripts > making a weapon menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English making a weapon menu

8 replies
To the start Previous 1 Next To the start

old making a weapon menu

robed
User Off Offline

Quote
hi guys

how to make this?

if you say something !menusucks then a menu will show

bind "k" "say !menusucks"

but i only need something like menu with weapons selection


thanks for advance

old Re: making a weapon menu

Homam
User Off Offline

Quote
That's my work! ^_^.
So, here's a sample.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("say","start")
	function start(id, txt)
		if (txt=="!menusucks") then
		menu(id,"name of the menu,buttons")
	end
end

addhook("menu","menustart")
	function menustart(id,m,b)
		if m=="name of the menu" then
			if b==1 then
			parse("equip "..id.." 45") -- You can change "45" to any weapon id
		end
	end
end

Check the code b4 posting "It don't work!"

old Re: making a weapon menu

robed
User Off Offline

Quote
like this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
parse("bind "k" "say !menusucks"")
addhook("say","start")
     function start(id, txt)
          if (txt=="!menusucks") then
          menu(id,"name of the menu,buttons")
     end
end

addhook("menu","menustart")
     function menustart(id,m,b)
          if m=="name of the menu" then
               if b==1 then
               parse("equip "..id.." 45") -- You can change "45" to any weapon id
          end
     end
end

old Re: making a weapon menu

Homam
User Off Offline

Quote
You can type on console (bind x "say !menusucks") but i dunno if it works if u put it on a script, because the lua is for all the players not only you.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview