Spoiler
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
-------------------------------------------------- -- Player Classes Script by Unreal Software -- -- 28.02.2009 - www.UnrealSoftware.de -- -- Adds Player Classes to your server -- -------------------------------------------------- if sample==nil then sample={} end sample.classes={} ----------------------- -- INITIAL SETUP -- ----------------------- function initArray(m) 	local array = {} 	for i = 1, m do 		array[i]=0 	end 	return array end sample.classes.class=initArray(32) function sample.classes.classmenu(id) 	menu(id,"Select your Class,Soldier|Armor+MG,Undead Guard|Last Of Undeads,Engineer|Wrench,Pyro|Flamethrower,Scout|Machete,Sniper|AWP")	 end ----------------------- -- TEAM -> CLASS -- ----------------------- addhook("team","sample.classes.team") function sample.classes.team(id,team) 	if (team>0) then 		sample.classes.classmenu(id) 	end end ----------------------- -- SERVERACTION -- ----------------------- addhook("serveraction","sample.classes.serveraction") function sample.classes.serveraction(id) 	sample.classes.classmenu(id) end ----------------------- -- CLASS SELECTION -- ----------------------- addhook("menu","sample.classes.menu") function sample.classes.menu(id,menu,sel) 	if (menu=="Select your Class") then 		if (sel>=0 and sel<=6) then 			sample.classes.class[id]=sel 			if (player(id,"health")>0) then 				parse("killplayer "..id) 			end 		end 	end end ----------------------- -- SPAWN -- ----------------------- addhook("spawn","sample.classes.spawn") function sample.classes.spawn(id) 	-- SOLDIER 	if (sample.classes.class[id]<=1) then 		parse ("setmaxhealth "..id.." 150") 		parse ("setarmor "..id.." 202") 		parse ("speedmod "..id.." -5") 		return "40,4,51"; 	end 	-- Undead 	if (sample.classes.class[id]==2) then 		parse ("setmaxhealth "..id.." 100") 		parse ("setarmor "..id.." 206") 		parse ("speedmod "..id.." 5") 		return "21,1"; 	end 	-- ENGINEER 	if (sample.classes.class[id]==3) then 		parse ("setmaxhealth "..id.." 100") 		parse ("setarmor "..id.." 50") 		return "10,2,74"; 	end 	-- PYRO 	if (sample.classes.class[id]==4) then 		parse ("setmaxhealth "..id.." 125") 		parse ("setarmor "..id.." 75") 		return "46,6,73"; 	end 	-- SCOUT 	if (sample.classes.class[id]==5) then 		parse ("setmaxhealth "..id.." 75") 		parse ("setarmor "..id.." 0") 		parse ("speedmod "..id.." 15") 		return "5,69,54"; 	end 	-- SNIPER 	if (sample.classes.class[id]==6) then 		parse ("setmaxhealth "..id.." 75") 		parse ("setarmor "..id.." 25") 		return "35,3,53"; 	end end ----------------------- -- NO BUYING -- ----------------------- addhook("buy","sample.classes.buy") function sample.classes.buy() 	return 1 end ----------------------- -- NO COLLECTING -- ----------------------- addhook("walkover","sample.classes.walkover") function sample.classes.walkover(id,iid,type) 	if (type>=61 and type<=68) then 		return 0 	end 	return 1 end ----------------------- -- NO DROPPING -- ----------------------- addhook("drop","sample.classes.drop") function sample.classes.drop() 	return 1 end ----------------------- -- NO DEAD DROPPING -- ----------------------- addhook("die","sample.classes.die") function sample.classes.die() 	return 1 end ----------------------- -- LEVEL -- ----------------------- function initArray(m) local array = {} for i = 1, m do array[i]=0 end return array end level=initArray(32) exp=initArray(32) function string.split(text,b) local cmd = {} if b then b = b else b = "%s" end b = "[^"..b.."]+" for o in string.gmatch(text,b) do table.insert(cmd,o) end return cmd end function totable(t,match) local cmd = {} if not match then match = "[^%s]+" end for word in string.gmatch(t, match) do table.insert(cmd, word) end return cmd end addhook("ms100","save_hud") function save_hud() for id = 1,32 do if (player(id,"exists")) then parse('hudtxt2 '..id..' 48 "©000100255Level: '..level[id]..' " 13 117') parse('hudtxt2 '..id..' 49 "©000100255Exp: '..exp[id]..'/8 " 13 129') end end end addhook("kill","save_kill") function save_kill(id) 	exp[id]=exp[id]+1 	if exp[id] == 8 then 		exp[id]=0 		level[id]=level[id]+1 		msg2(id,"©000255000Level up!@C") 		parse("sv_sound2 "..id.." levelup.wav") 		msg("©255075000"..player(id,"name").." reached "..level[id].." level!") 	end 	if exp[id] < 8 then 		parse("sv_sound2 "..id.." coin.wav") 	end end addhook("leave","save_leave") -- When you leave it saves function save_leave(id) if (player(id,"usgn")>0) then io.output(io.open("sys/lua/saves/"..player(id,"usgn")..".txt","w+")) io.write(exp[id].." "..level[id]) io.close() end end addhook("die","save_die") -- When you die it saves function save_die(id) if (player(id,"usgn")>0) then io.output(io.open("sys/lua/saves/"..player(id,"usgn")..".txt","w+")) io.write(exp[id].." "..level[id]) io.close() end end addhook("join","save_join") -- When join load function save_join(id) 	if (player(id,"usgn")>0) then 		local filename = "sys/lua/saves/%s.txt" 		local file = io.open(filename:format(player(id,"usgn"), "r")) 		local line 		if not file then 			line = {0, 1} 			msg2(id,"©255000000Failed to save!@C") 		else 			line = file:read("*a"):split() 		end 		exp[id] = tonumber(line[1]) or 0 -- If line[1] is not a number, level[id] becomes 1 		level[id] = tonumber(line[2]) or 1 -- Same as above reasoning (prevents errors) 	else 		msg2(id,"©255000000No USGN found!@C") 		level[id]=1 	end end addhook("parse","save_parse") function save_parse(cmd) 	_msg=totable(cmd) 	_t1=tostring(_msg[1]) 	if (_t1=="set_lvl") then 		_t2=tonumber(_msg[2]) 		_t3=tonumber(_msg[3]) 		level[_t2]=_t3 		msg2(_t2,"©000255000Admin set your level to ".._t3.."!@C") 		parse("sv_sound2 ".._t2.." levelup.wav") 		msg("©255075000Admin set "..player(_t2,"name").." level to ".._t3.."!") 	end 	if (_t1=="give_lvl") then 		_t2=tonumber(_msg[2]) 		_t3=tonumber(_msg[3]) 		level[_t2]=level[_t2]+_t3 		msg2(_t2,"©000255000Admin give you ".._t3.." levels!@C") 		parse("sv_sound2 ".._t2.." levelup.wav") 		msg("©255075000Admin give "..player(_t2,"name").." ".._t3.." levels!") 	end end addhook("say","save_say") function save_say(id,txt) 	if (txt=="!reset") then 		menu(id,"Reset your level?,Yes,No") 		parse("sv_sound2 "..id.." menu.wav") 		return 1 	end end addhook("say","save_sayy") function save_sayy(id,txt) 	if txt == "!lvl_help" then 		msg2(id,"©000255000Server commands:") 		msg2(id,"©100255100!lvl_help - see Level and Exp mode commands") 		msg2(id,"©100255100!reset - reset your level to 1") 		msg2(id,"©100255100!info - See player level and exp") 		return 1 	end end addhook("say","save_sayyy") function save_sayyy(id,txt) 	_msg=totable(txt) 	_t1=tostring(_msg[1]) 	if _t1 == "!info" then 		_t2=tonumber(_msg[2]) 		msg2(id,"©000100255"..player(_t2,"name").." has "..level[_t2].." level and "..exp[_t2].." exp.") 		return 1 	end end addhook("menu","save_menu") function save_menu(id,title,sel) 	if title == "Reset your level?" then 		if sel == 1 then 			msg("©255000000"..player(id,"name").." Has reset level!") 			level[id]=1 			exp[id]=0 		elseif sel == 2 then 			level[id]=level[id] 			exp[id]=exp[id] 		end 	end end addhook("minute","save_minute") function save_minute() 	msg("©000255000Level and Exp (v1.7) mode by RyceR") 	msg("©000255000Say !lvl_help to see Level and Exp mode commands") 	msg("©000255000Have Fun!") end ------------ --Fireball-- ------------ addhook("serveraction","my_serveraction") function my_serveraction(id,action) 	if action == 3 then 		shootFireball(id) 	end end rpiconst = 180 / math.pi imagepath = "sys/lua/fbmod/fireball.png" -- path to image speed = 25 --speed of fireball dmg = 100 --damage it does function initArray(m,v) local array = {} for i = 1, m do array[i]=v end return array end fireball = {x = 0,y = 0,dir = 0,fid = 0,exists=0,rot = 0} fireballs = initArray(32,fireball) -- each person can only have 1 fireball atm. function shootFireball(id) 	if(fireballs[id].exists ~= 0) then 		freeimage(fireballs[id].fid) 	end 	fireballs[id] = {x = player(id,"x"),y = player(id,"y"),dir =toRad(player(id,"rot")),fid = 0,exists = 1,rot = player(id,"rot")} 	drawFireball(id) end function toRad(deg) -- from degrees to radian 	return (deg / rpiconst) end function collision(xpos,ypos,id) 	if((xpos > player(id,"x") - 30) and (xpos < player(id,"x") + 30)) then 		if((ypos > player(id,"y") - 30) and (ypos < player(id,"y") + 30)) then 			--msg("collision!") 			return true 		end 	end 	return false end function updateFireball(id) --update position, check for bounds 	fireballs[id].y = fireballs[id].y - (math.cos(fireballs[id].dir)*speed) 	fireballs[id].x = fireballs[id].x + (math.sin(fireballs[id].dir)*speed) 	local xpos = fireballs[id].x -- tired of typing the long thing ;P 	local ypos = fireballs[id].y -- ditto 	for i,v in ipairs(player(0,"table")) do -- collision 		if(i ~= id) then 			if(collision(xpos,ypos,i)) then 				parse("sethealth "..i.." "..(player(i,"health")-dmg)) 			end 		end 	end 	if(fireballs[id].x > (map("xsize")*32) or fireballs[id].x < 0 or fireballs[id].y > (map("ysize")*32) or fireballs[id].y < 0) then --check for map boundaries 		fireballs[id].exists = 0 		freeimage(fireballs[id].fid) 	else 		imagepos(fireballs[id].fid,fireballs[id].x,fireballs[id].y,fireballs[id].rot) 	end end function drawFireball(id) -- draw and rotate. 	fireballs[id].fid=image(imagepath,fireballs[id].x,fireballs[id].y,1) 	imagepos(fireballs[id].fid,fireballs[id].x,fireballs[id].y,fireballs[id].rot) end addhook("ms100","my_ms100") function my_ms100() 	for i,v in ipairs(fireballs) do 		if(v.exists==0) then 			return 		end 		updateFireball(i) 	end end
Can someone help me?? I know it's Edit of classes in samples But i want the menu is on when i click F1 - serveraction 1 but menu is on when i click s action 1 s action 2 s action 3 pls help
And i want the fireball is work only on one class maybe undead guard and if i say +Skill then skill - fireball is not working plz help