Hier ist meine Frage:
Ich bin gerade dabei, etwas mit Menüs zu arbeiten aber dann kommt ein komischer unbeabsichtliger der sofort entfernt werden solltener Bug/Fehler.
Hier der Skript:
More 
Sinn des Skripts: Man hat am anfang ein paar Klassen! Wenn man spawnt, und man hat noch keine Klasse, kann man sich eine aussuchen!

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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
-- Etwas lang ~230 Zeilen code
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end
spy = initArray(32)
spy_pnt = initArray(32)
spy_lvl = initArray(32)
standard = initArray(32)
std_pnt = initArray(32)
std_lvl = initArray(32)
sniper = initArray(32)
snp_pnt = initArray(32)
snp_lvl = initArray(32)
heavy = initArray(32)
hvy_pnt = initArray(32)
hvy_lvl = initArray(32)
addhook("spawn","spawn_")
function spawn_(id)
	if spy[id]==0 and standard[id]==0 and sniper[id]==0 and heavy[id]==0 then
		msg("©255000255Welcome "..player(id,"name").." on our Server!")
		menu(id,"Classes:,Spy|Click for more informations!,Standard|Click for more information,Sniper|Click for more information,Heavy|Click for more information!")
	else
		msg2(id,"©000255000Welcome back!@C")
	end
end
addhook("menu","menu!")
function menu!(id,t,b)
	if t=="Classes:" then
		if b==1 then
			msg2(id,"©255000000The Spy!@C")
			msg2(id,"©255000000Is fast and silent!")
			msg2(id,"©255000000Weapons:")
			msg2(id,"©255255255-> TMP")
			msg2(id,"©255255255-> USP")
			msg2(id,"©255000000Best Weapon:")
			msg2(id,"©255000000Molotov and M4A1")
			msg2(id,"©255000000Use this Perks:")
			msg2(id,"©255255255More Speed!")
			msg2(id,"©255255255Spy - Menu")
			msg2(id,"©000255000Advance:")
			msg2(id,"©255000000Fast+Silent")
			msg2(id,"©255255255Has hidding-props")
			msg2(id,"©000255000Disadvanced:")
			msg2(id,"©255000000Cant use Radio")
			msg2(id,"©255255255Do you want to have this Class?")
			timer(300,"spymenu",id)
		elseif b==2 then
			msg2(id,"©255000000The Standard!@C")
			msg2(id,"©255255255Is strange and courageous!")
			msg2(id,"©255000000Weapons:")
			msg2(id,"©255255255-> M4A1")
			msg2(id,"©255255255-> Deagle")
			msg2(id,"©255000000Use this Perks:")
			msg2(id,"©255255255Maximum Armor")
			msg2(id,"©255255255Standard - Menu")
			msg2(id,"©000255000Advance:")
			msg2(id,"©255000000He's like a Warrior")
			msg2(id,"©000255000Disadvanced:")
			msg2(id,"©255000000Cant use Chat")
			msg2(id,"©255255255Do you want to have this Class?")
			timer(300,"standardmenu",id)
		elseif b==3 then
			msg2(id,"©255000000The Sniper!@C")
			msg2(id,"©255255255Is Silent and invisible!")
			msg2(id,"©255000000Weapons:")
			msg2(id,"©255255255-> AWP and Scout")
			msg2(id,"©255255255-> Deagle")
			msg2(id,"©255000000Use this Perks:")
			msg2(id,"©255255255Deagle 2 Hit!")
			msg2(id,"©255255255Scout 1 Hit")
			msg2(id,"©000255000Advance:")
			msg2(id,"©255000000Quick and Clean")
			msg2(id,"©000255000Disadvanced:")
			msg2(id,"©255000000Is slowly")
			msg2(id,"©255255255Do you want to have this Class?")
			timer(300,"snipermenu",id)
		elseif b==4 then
			msg2(id,"©255000000The Heavy!@C")
			msg2(id,"©255255255He is the fight!")
			msg2(id,"©255000000Weapons:")
			msg2(id,"©255255255-> M249")
			msg2(id,"©255255255-> Flamethrower")
			msg2(id,"©255000000Use this Perks:")
			msg2(id,"©255255255MEDIC!")
			msg2(id,"©000255000Advance:")
			msg2(id,"©255000000Has much energie")
			msg2(id,"©000255000Disadvanced:")
			msg2(id,"©255000000Is slowly")
			msg2(id,"©255255255Do you want to have this Class?")
			timer(300,"heavymenu",id)
		end
	elseif t=="Spy" or t=="Warrior" or t=="Sniper" or t=="Heavy" then
		if b==2 then
			menu(id,"Classes:,Spy|Click for more informations!,Standard|Click for more information,Sniper|Click for more information,Heavy|Click for more information!")
		end
	elseif t=="Spy" then
		if b==1 then
			spy[id]=1
			standard[id]=0
			sniper[id]=0
			heavy[id]=0
		end
	elseif t=="Warrior" then
		if b==1 then
			spy[id]=0
			standard[id]=1
			sniper[id]=0
			heavy[id]=0
		end
	elseif t=="Sniper" then
		if b==1 then
			spy[id]=0
			standard[id]=0
			sniper[id]=1
			heavy[id]=0
		end
	elseif t=="Heavy" then
		if b==1 then
			spy[id]=0
			standard[id]=0
			sniper[id]=0
			heavy[id]=1
		end
	elseif t=="Restart?" then
		if b==1 then
			spy[id]=0
			standard[id]=0
			sniper[id]=0
			heavy[id]=0
			menu(id,"Classes:,Spy|Click for more informations!,Standard|Click for more information,Sniper|Click for more information,Heavy|Click for more information!")
		elseif b==2 then
			msg2(id,"©255255255You dont repeat? Okay!@C")
		end
	end
end
-- Class-Menu
function spymenu(id)
	menu(id,"Spy,I want to have it!,I dont want to have it!")
end
function standardmenu(id)
	menu(id,"Warrior,I want to have it!,I dont want to have it!")
end
function snipermenu(id)
	menu(id,"Sniper,I want to have it!,I dont want to have it!")
end
function heavymenu(id)
	menu(id,"Heavy,I want to have it!,I dont want to have it!")
end
addhook("kill","kill")
function kill(k,v,w,x,y)
	if player(k,"team")~=player(v,"team") then	
		if spy[k]			==1 then
			spy_pnt[k]=spy_pnt[k]+1
		elseif standard[k]	==1 then
			std_pnt[k]=std_pnt[k]+1
		elseif sniper[id]	==1 then
			snp_pnt[k]=snp_pnt[k]+1
		elseif heavy[id]	==1 then
			hvy_pnt[k]=hvy_pnt[k]+1
		end
	elseif spy_pnt[k]>=50 then
		spy_pnt[k]=0
		spy_lvl[k]=spy_lvl[k]+1
		msg("©000000000"..player(k,"name").." reached Level "..spy_lvl.."!")
	elseif std_pnt[k]>=50 then
		std_pnt[k]=0
		std_lvl[k]=std_lvl[k]+1
		msg("©000000000"..player(k,"name").." reached Level "..std_lvl.."!")
	elseif snp_pnt[k]>=50 then
		snp_pnt[k]=0
		snp_lvl[k]=snp_lvl[k]+1
		msg("©000000000"..player(k,"name").." reached Level "..snp_lvl.."!")
	elseif hvy_pnt[k]>=50 then
		hvy_pnt[k]=0
		hvy_lvl[k]=hvy_lvl[k]+1
		msg("©000000000"..player(k,"name").." reached Level "..hvy_lvl.."!")
	end
end
addhook("ms100","ms100")
function ms100()
	for _, id in ipairs(player(0,"table")) do
		if spy_lvl[id]<=0 then
			spy_lvl[id]=1
		elseif std_lvl[id]<=0 then
			std_lvl[id]=1
		elseif snp_lvl[id]<=0 then
			snp_lvl[id]=1
		elseif hvy_lvl[id]<=0 then
			hvy_lvl[id]=1
		elseif spy_lvl[id]>=5 then
			menu(id,"Restart?,Yes|I want to have another class!,No|I want to play further!")
			spy_lvl[id]=5
		elseif std_lvl[id]>=5 then
			menu(id,"Restart?,Yes|I want to have another class!,No|I want to play further!")
			std_lvl[id]=5
		elseif snp_lvl[id]>=5 then
			menu(id,"Restart?,Yes|I want to have another class!,No|I want to play further!")
			snp_lvl[id]=5
		elseif hvy_lvl[id]>=5 then
			menu(id,"Restart?,Yes|I want to have another class!,No|I want to play further!")
			hvy_lvl[id]=5
		end
		if spy[id]==1 then
			parse('hudtxt2 '..id..' 1 "©255000000Level: '..spy_lvl[id]..' " 550 200')
			parse('hudtxt2 '..id..' 2 "©255000000Level: '..spy_pnt[id]..' " 550 200')
		elseif standard[id]==1 then
			parse('hudtxt2 '..id..' 1 "©255000000Level: '..std_lvl[id]..' " 550 200')
			parse('hudtxt2 '..id..' 2 "©255000000Level: '..std_pnt[id]..' " 550 200')
			elseif sniper[id]==1 then
			parse('hudtxt2 '..id..' 1 "©255000000Level: '..snp_lvl[id]..' " 550 200')
			parse('hudtxt2 '..id..' 2 "©255000000Level: '..snp_pnt[id]..' " 550 200')
		elseif heavy[id]==1 then
			parse('hudtxt2 '..id..' 1 "©255000000Level: '..hvy_lvl[id]..' " 550 200')
			parse('hudtxt2 '..id..' 2 "©255000000Level: '..hvy_pnt[id]..' " 550 200')
		end
	end
end
Wenn ich spawne, dann wird das Menü nicht angezeigt!
Aber in der Konsole (^) wird kein Error oder ähnliches angezeigt:
Spoiler 

load map 'de_dust'
----- Server started -----
Warning: 'Offline / LAN'-mode is ENABLED. Server will NOT be added to serverlist. Other
players on the internet will NOT see this server on their serverlist. Enter 'sv_lan 0' in your
console or disable the 'Offline / LAN'-checkbox to change this setting.
Lua: Adding function 'spawn_' to hook 'spawn'
Lua: Adding function 'menu' to hook 'menu'
Lua: Adding function 'kill' to hook 'kill'
Lua: Adding function 'ms100' to hook 'ms100'
MC_Bowlinghead joins the counter-terrorist forces
Welcome MC_Bowlinghead on our Server!
----- Server started -----
Warning: 'Offline / LAN'-mode is ENABLED. Server will NOT be added to serverlist. Other
players on the internet will NOT see this server on their serverlist. Enter 'sv_lan 0' in your
console or disable the 'Offline / LAN'-checkbox to change this setting.
Lua: Adding function 'spawn_' to hook 'spawn'
Lua: Adding function 'menu' to hook 'menu'
Lua: Adding function 'kill' to hook 'kill'
Lua: Adding function 'ms100' to hook 'ms100'
MC_Bowlinghead joins the counter-terrorist forces
Welcome MC_Bowlinghead on our Server!
Nur das witzige dabei ist, wenn ich denn Menü-Hook ganz weg mache, dann wird das Menü beim spawnen angezeigt! (Aber ich kann nichts drücken, weil der Menü Hook ja weg ist!)
Der Skript denn ihr da oben seht ist der ganze bis-jetzt geschriebene Skript.
------------------------------------------
Ist euch das auch passiert? Was habt ihr gemacht?
Hab ich etwas vergessen?
Ist es ein Bug?
Bin ich zu blöd?
Wer weiß...
------------------------------------------
Der "menu" Hook wird nicht ausgeführt. Warum?
1 
Offline