Forum

> > CS2D > Scripts > Menu + Menu ?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Menu + Menu ?

5 replies
To the start Previous 1 Next To the start

old Menu + Menu ?

Skill
User Off Offline

Quote
Plasse


° I how making the Menu
Example

Menu / iteam menu / armor menu / .../...

I m New is making lua
How making the MENU + MENU

old Re: Menu + Menu ?

Mora
User Off Offline

Quote
use menu hook for make the new menu in the menu.
For example call your fcking menu by:
1
2
3
4
5
6
addhook("serveraction","_serveraction")
function _serveraction(id,action)
	if action==1 then
menu(id,"Shit menu N1,Shit menu N2,Shit menu N3")
	end
end

then you have to use menu hook..
1
2
3
4
5
6
7
8
9
10
addhook("menu","_menu")
function _menu(id,title,button)
	if title=="Shit menu N1" then
		if button==1 then
menu(id,"Shit menu N2,1,2,3,4,5")
		elseif button==2 then
menu(id,"Shit menu N3,1,2,3,4,5")
		end
	end
end

And improve your english.

old Re: Menu + Menu ?

Nekomata
User Off Offline

Quote
Creating a menu from scratch is your worst nightmare, especially if you're going to add pagination(pages). Following what user Mora said, you can use user VADemon 's updated unimenu.

E.g;
1
2
3
4
5
6
7
addhook("serveraction","_serveraction")
function _serveraction(id,action)
     if action==1 then
	--menu(id,"Shit menu N1,Shit menu N2,Shit menu N3")
	--Call unimenu here instead of the normal cs2d menu function
     end
end

old Re: Menu + Menu ?

VADemon
User Off Offline

Quote
UniMenu 2.0 in a nut shell:
1
2
3
4
5
6
do
   local menuID = unimenu_newMenu("rambozan_item_menu", "My awesome armor menu!")

   unimenu_addButton(menuID, "Super armor", "IT'S FREE!", {}, function (id); parse("equip ".. id .." 83"); end)
   -- and you've created a menu with one button
end

And don't expect some good soul to make a Lua script for you. You will have to learn from other existing Lua scripts already uploaded / read forum threads or Lua tutorials. This will most probably pose a challenge but may also change your whole life.

old Thank

Skill
User Off Offline

Quote
Thank you all!

old Code

Paulo49
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("serveraction","example")
function example(id, act)
     if act == 1 then
          menu(id,'TEST,1,2')
     end
end

addhook("menu","example2")
function example2(id,title,button)
     if title == "TEST" then
          if button == 1 then
               msg2(id,'Hello World!')
          end
     end
     return 1
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview