Forum

> > CS2D > Scripts > Menu Not Working
Forums overviewCS2D overview Scripts overviewLog in to reply

English Menu Not Working

4 replies
To the start Previous 1 Next To the start

old Menu Not Working

KagamineLen
User Off Offline

Quote
Can someone help me fix my menu because my menu did not work properly, i cant do it properly its so confusing.

anyway here's the code
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
27
28
29
30
31
32
33
34
35
36
37
38
addhook("menu","HelpMenu")
function HelpMenu(id,title)

	if title=="!Teleport" then
		msg2(id,"©000255000!Teleport [X] [Y] -- Teleports You To ..x.. ..y.. On The Map"); end
	if title=="!Earthquake" then
		msg2(id,"©000255000!Earthquake [LENGTH] -- Make an Haiti earthquake!"); end
	if title=="!Speed" then
		msg2(id,"©000255000!Speed [Value] -- Gives You a Speed with Value-XX"); end
	if title=="!Ban" then
		msg2(id,"©000255000!Ban [ID] [REASON] -- Ban a Player"); end
	if title=="!Jump" then
		msg2(id,"©000255000!Jump [ID] -- Bring yourself to Player[ID]"); end
	if title=="!Explode" then
		msg2(id,"©000255000!Explode [DMG] -- Spawn explosion"); end
	if title=="!Bring" then
		msg2(id,"©000255000!Bring [ID] -- Bring Player[ID] to you"); end
	if title=="!Equip" then
		msg2(id,"©000255000!Equip [ID] -- Equip a Weapon"); end
	if title=="!Kick" then
		msg2(id,"©000255000!Kick [ID] [REASON] -- Kick a Player"); end
	if title=="!Help" then
		msg2(id,"©000255000!Help -- To show this help menu"); end
	if title=="!Spawnitem" then
		msg2(id,"©000255000!Spawnitem [ITM] -- Spawn an Item"); end
	if title=="!Broadcast" then
		msg2(id,"©000255000!Broadcast [MSG] -- Broadcast a message"); end
	if title=="!Setmaxhealth" then
		msg2(id,"©000255000!Setmaxhelth -- set yourself to max health"); end
	if title=="!@Say" then
		msg2(id,"©000255000@Say [MSG] -- Say a message with the repective privilege"); end
			if title=="Next" then
		menu(id,"!Help,!Spawnitem,!Broadcast,@Say"); end
end

function AdminHelp(id)
	menu(id,"Help Menu,!Teleport,!Earthquake,!Speed,!Ban,!Jump,!Explode,!Bring,!Equip,Next")
end

old Re: Menu Not Working

EngiN33R
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
addhook("menu","HelpMenu")
function HelpMenu(id,title,sel)
if (title=="Help Menu") then
     if sel==1 then
          msg2(id,"©000255000!Teleport [X] [Y] -- Teleports You To ..x.. ..y.. On The Map") end
     if sel==2 then
          msg2(id,"©000255000!Earthquake [LENGTH] -- Make a Haiti earthquake!") end
     if sel==3 then
          msg2(id,"©000255000!Speed [Value] -- Gives You the Speed of XX") end
     if sel==4 then
          msg2(id,"©000255000!Ban [ID] [REASON] -- Ban a Player") end
     if sel==5 then
          msg2(id,"©000255000!Jump [ID] -- Bring yourself to Player[ID]") end
     if sel==6 then
          msg2(id,"©000255000!Explode [DMG] -- Spawn explosion") end
     if sel==7 then
          msg2(id,"©000255000!Bring [ID] -- Bring Player[ID] to you") end
     if sel==8 then
          msg2(id,"©000255000!Equip [ID] -- Equip a Weapon") end
     if sel==9 then
          menu(id,"Help Menu 2,!Kick,!Help,!Spawnitem,!Broadcast,@Say") end
     end
end
if (title=="Help Menu 2") then
     if sel==1 then msg2(id,"©000255000!Kick [ID] [REASON] -- Kick a Player") end
     if sel==2 then
          msg2(id,"©000255000!Help -- Show this help menu") end
     if sel==3 then
          msg2(id,"©000255000!Spawnitem [ITM] -- Spawn an Item") end
     if sel==4 then
          msg2(id,"©000255000!Broadcast [MSG] -- Broadcast a message") end
     if sel==5 then
          msg2(id,"©000255000!Setmaxhelth -- set yourself to max health") end
     if sel==6 then
          msg2(id,"©000255000@Say [MSG] -- Say a message with the respective privilege") end
end
end

function AdminHelp(id)
     menu(id,"Help Menu,!Teleport,!Earthquake,!Speed,!Ban,!Jump,!Explode,!Bring,!Equip,Next")
end

I hope you now understood your mistakes. If not, I'll explain.

old Re: Menu Not Working

Apache uwu
User Off Offline

Quote
Lua is pretty loose, you do not need a semicolon, you can just have all the code on 1 line if you wanted.

old Re: Menu Not Working

KagamineLen
User Off Offline

Quote
yeah i understood my mistakes, i am just confused when making menu, i thought that "title" is for title of the menu and "buttons" is for buttons
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview