Forum

> > CS2D > Scripts > menu's script
Forums overviewCS2D overview Scripts overviewLog in to reply

English menu's script

5 replies
To the start Previous 1 Next To the start

moved menu's script

-Darkman
User Off Offline

Quote
Hi users us , i made with myself short script but i try edit it to work again and again but i cannot fix it .. sow please try to array it .


> There is 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
addhook("menu","Onmenu")
addhook("serveraction","Onact")

function Onmenu(id,act)
	if id==1 then
		if act==1 then
			menu(id,"Admin's Controling,Server Setting")
		end
		if act==2 then
		menu(id,"Admin's Commands,Equipments,Speed List")
		end

	end
end

function Onmenu_l(id,act)
menu(id,"Server Setting,Bot's menu,Friendlyfire|ON;OFF,Fow|ON;OFF")
end
function Onmenu_ll(id,act)
menu(id,"Equipments:,Pistols,Shotguns,SMGs,Melee,Snipers,Armors,More items")
end
function Onmenu_lll(id,act)
menu(id,"Speed List:,set speed : 25,set speed : 50,set speed : 75,set speed : 100,+20 speed")
if 	btn==1 then
		parse("speedmod "..id.." 25")
	end
		if btn==2 then
			parse("speedmod "..id.." 50")
		end
			if btn==3 then
				parse("speedmod "..id.." 75")
			end
		if btn==4 then
			parse("speedmod "..id.." 100")
		end
	if btn==5 then
		parse("speedmod "..id.." "..player(id,"speedmod")+20)
	end
end

function Onact(id,title,btn)
	if title=="Admin's Controling" then
	if btn==1 then
	if title=="Server Setting" then
	end
	end
	end
	if title=="Admin's Commands" then
	if btn==1 then
	menuequip(id)
	end
	if btn==2 then
	end
	end
end

Admin/mod comment

Moved to CS2D script section. /Starkkz

old Re: menu's script

Rainoth
Moderator Off Offline

Quote
Why is this in minigolf madness ._o ?
It's so unclean that I'm not going to bother to fix it, though I'd advise you to change
1
if id==1 then
into
1
if player(id,"usgn") == 113332 then
assuming that you want it to work only for you, else it would work for everyone who would have ID 1.

Also. I don't know if it's just a part of code but if it's the whole code, you're missing hooks for functions Onmenu_l(l/ll)

old Re: menu's script

-Darkman
User Off Offline

Quote
that code need array ... sow anyone please array it to complete my script..


@user Rainoth: i know this code work for player-ID:1
IF you have lua script such as this (about hooks :menu/serveraction) .. show me it

old Re: menu's script

Avo
User Off Offline

Quote
There are tones of admin scripts in the f.a. How about using one of them?

old Re: menu's script

DarkBooy
User Off Offline

Quote
Like this ?
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
admins = {1,89037,113332}

function isAdmin(id)
	for _, m in pairs(admins) do
		if (player(id,"usgn")==m) then
		  return 1
		end
	  return 0
	end
end
----------Menus--------------
function menuI(id)
	menu(id,"Admin's Controling,Server Setting")
	end
function menuII(id)
	menu(id,"Admin's Commands,Equipments,Speed List")
	end
function menuIII(id)
	menu(id,"Server Setting,Bot's menu,Friendlyfire|ON;OFF,Fow|ON;OFF")
	end
function menuVI(id)
	menu(id,"Equipments:,Pistols,Shotguns,SMGs,Melee,Snipers,Armors,More items")
	end
function menuVII(id)
	menu(id,"Speed List:,set speed : 0,set speed : 25,set speed : 50,set speed : 75,set speed : 100,+20 speed")
	end
------------------------------
function serv(id,act)
	if isAdmin(id) then
		if act==1 then
			menuI(id)
		elseif act==2 then
			menuII(id)
		end
	end
end
-----------addhooks-----------
addhook("serveraction","serv")
addhook("menu","Onmenu")
------------------------------
function Onmenu(id,title,btn)
	if title=="Admin's Controling" then
		if btn==1 then
			menuIII(id)
		end
	end
	if title=="Admin's Commands" then
		if btn==1 then
			menuVI(id)
		elseif btn==2 then
			menuVII(id)
		end
	end
	if title=="Speed List:" then
		if btn==1 then
			parse("speedmod "..id.." 0")
		elseif btn==2 then
			parse("speedmod "..id.." 25")
		elseif btn==3 then
			parse("speedmod "..id.." 50")
		elseif btn==4 then
			parse("speedmod "..id.." 75")
		elseif btn==5 then
			parse("speedmod "..id.." 100")
		elseif btn==6 then
			parse("speedmod "..id.." "..player(id,"speedmod")+20)
		end
	end
end

INFO
IT should work.

old Re: menu's script

-Darkman
User Off Offline

Quote
Wow thanks @user DarkBooy: its beautiful and that what i want

maybe many players didn't understand me but , you smart and you added some functions , Thanks pro ~
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview