Forum

> > CS2D > Scripts > Simpler Menu
Forums overviewCS2D overview Scripts overviewLog in to reply

English Simpler Menu

2 replies
To the start Previous 1 Next To the start

old Simpler Menu

Ridho
User Off Offline

Quote
I have a request , I made some basic serveractions with its menu script, for example like this:

1
2
3
4
5
6
7
8
9
10
11
12
addhook("serveraction","test_")
function test_(id,action)
 if action == 1 then
  menu(id,"Ability, Fast Reload|"..rprice..", Fast Building|"..bprice.."")
 elseif action == 1 and freload[id]==1 then
  menu(id,"Ability,(Fast Reload|Bought), Fast Building|"..bprice.."")
 elseif action == 1 and fbuild[id]==1 then
  menu(id,"Ability, Fast Reload|"..rprice..",(Fast Building|Bought)")
 elseif action == 1 and freload[id]==1 and fbuild[id]==1 then
  menu(id,"Ability,(Fast Reload|Bought),(Fast Building|Bought)")
 end
end

I just make 2 menus in there, but it waste my time to make it 1 by 1

I've saw a simpler script from nowhere but I forget it's parts and I dont know how I can start it I think it be like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function test_()
 if freload[id]==1 then
  rmenu="(Fast Reload|Bought)"
 else
  rmenu="Fast Reload|"..rprice.."
 end
 if fbuild[id]==1 then
  bmenu="(Fast Build|Bought)"
 else
  bmenu="Fast Build|"..bprice.."
 end
end

addhook("serveraction","test")
function test(id,action)
 if action==1 then
  menu(id,"Ability,"..rmenu..","..bmenu.."")
 end
end

I think the last one is simpler because I just need to copy-paste then edit it, and it doesnt hurt my eyes anymore,. or maybe someone can fix my script or make a new simpler one thanks
edited 1×, last 20.12.14 08:01:25 pm

old Re: Simpler Menu

Ajmin
User Off Offline

Quote
WoW i was also making a script like this today!
but unfortunately i failed
it will be so helpful for me too if someone help with this!

old Re: Simpler Menu

ReVoltage
User Off Offline

Quote
Not really simple, but at least you save a function, row, and life.
1
2
3
4
5
6
7
8
9
10
addhook("serveraction","test")
function test(id,action)
if action==1 then
	local rmenu="Fast Reload|"..rprice.."
	local bmenu="Fast Build|"..bprice.."
	if freload[id]==1 then rmenu="(Fast Reload|Bought)" end
	if fbuild[id]==1 then bmenu="(Fast Build|Bought)" end
 	menu(id,"Ability,"..rmenu..","..bmenu.."")
end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview