Forum

> > CS2D > Scripts > Menu error and hud thing..
Forums overviewCS2D overview Scripts overviewLog in to reply

English Menu error and hud thing..

5 replies
To the start Previous 1 Next To the start

old Menu error and hud thing..

Glix
User Off Offline

Quote
There is the first button
1
2
elseif button == 9 then
menu(id,"Admin Settings-2,Nuke Set|>,Give Weapon|>,Make Admin|>,Make mod|>,Set Speed|>,Settings|>,Make vip|>")
when i press it then opens this
1
2
elseif button == 7 then
menu(id,"Make vip with MSG,Make viP?")
when i press this again it open this one
1
2
3
4
5
6
7
8
addhook("menu","menuuu1")
function menuuu1(id,tittle,button)
if tittle == "Make vip With MSG" then
if button == 1 then
msg2(id,"Say @give_vip [USGN]")
end
end
end
But when i press this i got in console LUA ERROR: attempt to call nil value



=================================

Don't wanted to make new thread for this one…

What wrong with 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
addhook("say","infosay")
function infosay(id,txt)
if (txt=="!rules") then
if info[id]==0 then
parse('hudtxt2 '..id..' 28 "©181181181!Rules" 460 215')
parse('hudtxt2 '..id..' 29 "©181181181Do not Hack." 460 230')
parse('hudtxt2 '..id..' 30 "©181181181Do not Flame." 460 245')
parse('hudtxt2 '..id..' 31 "©181181181Do not Spawn/Teleport kill." 460 260')
parse('hudtxt2 '..id..' 32 "©181181181Do not Ask for RCon" 460 275')
parse('hudtxt2 '..id..' 33 "©181181181Do not Be an asshole." 460 290')
info[id]=1
return 1
elseif info[id]==1 then
parse('hudtxt2 '..id..' 26 " " 250 185')
parse('hudtxt2 '..id..' 27 " " 250 185')
parse('hudtxt2 '..id..' 28 " " 250 200')
parse('hudtxt2 '..id..' 37 " " 250 220')
parse('hudtxt2 '..id..' 29 " " 250 250')
info[id]=0
return 1
end
end
end

addhook("join","mex")
function mex(id,hud)
parse('hudtxt2 '..id..' 36 "©255255255# !rules to read rules)" 450 155 0')
parse('hudtxt2 '..id..' 26 "©255255255# Clan Forum:" 450 170 0')
parse('hudtxt2 '..id..' 27 "©255255255# www.tedaclan.net46.net" 450 185 0')
end
edited 1×, last 25.08.12 12:10:00 pm

old Re: Menu error and hud thing..

Jynxxx
User Off Offline

Quote
First never use those crappy admin menu systems, they don't even take time to make it properly!
Second you just had things in the wrong place for your say hook.
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
for i=1,32 do
	info = 0
end

addhook("say","infosay")
function infosay(id,txt)
	if (txt=="!rules") then
		if info[id]==0 then
			parse('hudtxt2 '..id..' 28 "©181181181!Rules" 460 215')
			parse('hudtxt2 '..id..' 29 "©181181181Do not Hack." 460 230')
			parse('hudtxt2 '..id..' 30 "©181181181Do not Flame." 460 245')
			parse('hudtxt2 '..id..' 31 "©181181181Do not Spawn/Teleport kill." 460 260')
			parse('hudtxt2 '..id..' 32 "©181181181Do not Ask for RCon" 460 275')
			parse('hudtxt2 '..id..' 33 "©181181181Do not Be an asshole." 460 290')
			info[id]=1
		else
			parse('hudtxt2 '..id..' 26 " " 250 185')
			parse('hudtxt2 '..id..' 27 " " 250 185')
			parse('hudtxt2 '..id..' 28 " " 250 200')
			parse('hudtxt2 '..id..' 37 " " 250 220')
			parse('hudtxt2 '..id..' 29 " " 250 250')
			info[id]=0
		return 1
		end
	end
end

addhook("join","mex")
function mex(id,hud)
	parse('hudtxt2 '..id..' 36 "©255255255# !rules to read rules)" 450 155 0')
	parse('hudtxt2 '..id..' 26 "©255255255# Clan Forum:" 450 170 0')
	parse('hudtxt2 '..id..' 27 "©255255255# www.tedaclan.net46.net" 450 185 0')
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview