Then I try to edite sys/lua/CF/mods/admin.lua
I getting this error..
Does anyone know how to fix it?
If its helps.
admin.lua
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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
admin = {119643} vips = {} gmlist = {} 		 function InitArray(m,val) array={} 	for i=1,m do 		array[i]=val 	end return array end function radiusmsg(words, x, y, radiusx, radiusy) 	print(words) 	if not (radiusx and radiusy) then radiusx, radiusy = 540, 440 end 	local x1, y1, x2, y2 = x-radiusx, y-radiusy, x+radiusx, y+radiusy 	for _, v in ipairs(player(0, 'table')) do 		if player(v, 'x') >= x1 and player(v, 'x') <= x2 and player(v, 'y') >= y1 and player(v, 'y') <= y2 then 			msg2(v,words) 		end 	end 	return 1 end function message(id, text, colour) 	if text:sub(-2) == "@C" then 		msg2(id,(string.char(169).." " .. tostring(colour) or "") " Proximity " .. text) 	else 		text = text:gsub("\n", "¦") 		local tbl = {} 		repeat 			table.insert(tbl, text:sub(#tbl+1, math.min(#text, (#tbl+1)*90))) 			text = text:sub(#tbl*90) 		until #text == 0 		for k, v in ipairs(tbl) do 			msg2(id,(string.char(169).." " .. tostring(colour) or "") " Proximity " .. v) 		end 	end end 		 function admina(id) 	for _, usgn in ipairs(admin) do 	if player(id,'usgn') == usgn then 	return true 	end 	end 	return false end function vipa(id) 	for _, usgn in ipairs(vips) do 	if player(id,'usgn') == usgn then 	return true 	end 	end 	return false end function gms(id) 	for _, usgn in ipairs(gmlist) do 	if player(id,'usgn') == usgn then 	return true 	end 	end 	return false end addhook("say","say_config") function say_config(id,txt) local p = totable(txt) local cmd = tostring(p[1]) local pa = tonumber(p[2]) local py = tonumber(p[3]) local pma = tostring(p[3]) if admina(id) then if cmd == "@kick" then if player(pa,"exists") then msg(string.char(169).."000255000"..player(id,"name").." [Admin] Kicked "..player(pa,"name")) parse("kick "..pa.." "..pma) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@btp" then if player(pa,"exists") then parse('setpos '..pa..' '..player(id,'x')..' '..player(id,'y')) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@give_gp" then if player(pa,"exists") then US[pa]=US[pa]+py msg2(id,string.char(169)..'255000000You gave '..player(pa,'name')..' , a total of : '..py..' at gp.') msg2(pa,string.char(169)..'255000000[Admin] : '..player(id,'name')..' Gave to you , Total in GP : '..py) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@remove_gp" then if player(pa,"exists") then US[pa]=US[pa]-py msg2(id,string.char(169)..'255000000You Remove Gp to '..player(pa,'name')..' , Total in GP : '..py) msg2(pa,string.char(169)..'255000000[Admin] : '..player(id,'name')..' Removed from you , Total in GP : '..py) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@remove_vcoin" then if player(pa,"exists") then vcoin[pa]=vcoin[pa]-py msg2(id,string.char(169)..'255000000You Remove Vcoin '..player(pa,'name')..' , Total in Vcoin : '..py) msg2(pa,string.char(169)..'255000000[Admin] : '..player(id,'name')..' Removed from you , Total in Vcoin : '..py) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@give_vcoin" then if player(pa,"exists") then vcoin[pa]=vcoin[pa]+py msg2(id,string.char(169)..'255000000You gave '..player(pa,'name')..' , a total of : '..py..' at vcoin.') msg2(pa,string.char(169)..'255000000[Admin] : '..player(id,'name')..' Gave to you , Total in Vcoin : '..py) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@tp" then if player(pa,"exists") then parse('setpos '..id..' '..player(pa,'x')..' '..player(pa,'y')) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@slow" then if player(pa,"exists") then parse("speedmod "..pa.." -100") return 1	 else msg2(id,"Player "..pa.." not exist") return 1 end	 end if cmd == "@spec" then if player(pa,"exists") then parse("makespec "..pa) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@kill" then if player(pa,"exists") then parse("killplayer "..pa) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@slap" then if player(pa,"exists") then parse("slap "..pa) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd =="@restart" then parse("restart") return 1 end if cmd =="@usgn" then if player(pa,"exists") then msg2(id,string.char(169).."255123255Name : "..player(pa,"name").."") msg2(id,string.char(169).."255123255USGN : "..player(pa,"usgn").."") msg2(id,string.char(169).."255123255IP : "..player(pa,"ip").."") return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@shake" then if player(pa,"exists") then parse("shake "..pa.." 10000") return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@banusgn" then if player(pa,"exists") then parse("banusgn "..pa) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@noslow" then if player(pa,"exists") then parse("speedmod "..pa.." 0") return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@banip" then if player(pa,"exists") then parse("banip "..pa) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@banname" then if player(pa,"exists") then parse("banname "..pa) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd:lower() == "@say" then local gerals=txt:sub(5) msg(string.char(169).."255255255Rank : "..string.char(169).."255000000[Admin] "..string.char(169).."000255255"..player(id,"name")..","..string.char(169).."136209580Say:"..gerals) return 1 end end if vipa(id) then if cmd == "@btp" then if player(pa,"exists") then parse('setpos '..pa..' '..player(id,'x')..' '..player(id,'y')) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "@tp" then if player(pa,"exists") then parse('setpos '..id..' '..player(pa,'x')..' '..player(pa,'y')) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd:lower() == "@say" then local gerals=txt:sub(5) msg(string.char(169).."255255255Rank : "..string.char(169).."362095805[VIP] "..string.char(169).."000255255"..player(id,"name")..","..string.char(169).."136209580Say:"..gerals) return 1 end if cmd == "@kick" then if player(pa,"exists") then parse("kick "..pa) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end end if gms(id) then if cmd == "@say" then local gerals=txt:sub(5) msg(string.char(169).."255255255Rank : "..string.char(169).."255255000[GoldMember] "..string.char(169).."000255255"..player(id,"name")..","..string.char(169).."255255000Say:"..gerals.." .") return 1 end end if cmd == "!stats" then if (player(pa,"exists")) then menu(id," "..player(pa,"name").." @b, Level : "..level[pa].." , Exp : "..exp[pa].." | "..nexp[pa].." , GP : "..US[pa].." | Vcoin : "..vcoin[pa].." , PVP : "..pvps[pa].." , Building Department: "..build[pa].." , Tank Ammunition: "..Tank[pa].." , USGN: "..player(pa,"usgn").." , FOOD:"..food[pa].." , Health : "..player(pa,"health").." |MORE HP : "..ehealth[pa].." ") return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "!help" then menu(id,"Help Menu,Command Help,About,[CK]Servers|REROUT SYSTEM") return 1 end if cmd == "!save" then if (player(id, "usgn") > 0) then cf_save(id) msg2(id,string.char(169).."000255000Their data were successfully saved.") return 1 else if (player(id,"ip") >"0.0.0.0") then cf_saveip(id) msg2(id,string.char(169).."000255000Not logged in USGN, and data were saved in the protocol IP") msg2(id,string.char(169).."000255000IP :"..player(id,"ip").." ") return 1 else msg2(id,"Your Server dont use Save.") return 1 end end end if cmd == "!report" then if player(pa,"exists") then msg2(id,string.char(169).."159158874Your Report : "..player(pa,"name").." Used : "..pma) msg2(id,string.char(169).."159158874Needle will see infomation of "..player(pa,"name")..","..string.char(169).."051204153Thank You") SScore = io.open("sys/lua/CF/mods/reports/"..player(pa,"name")..".txt", "a") SScore:write("\n\nName : "..player(pa,"name").."\nUsgn : "..player(pa,"usgn").."\nIP : "..player(pa,"ip").."\nInformation : "..pma.."\nDate : "..os.date("%x - %H:%M:%S").."\n\nReported by : "..player(id,"name").."\nUsgn : "..player(id,"usgn").."\nIP : "..player(id,"ip")) SScore:close() return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end	 if string.lower(cmd) == "!pvp" then if pvp[id] == 0 then pvps[id] = "ON" pvp[id] = 1 msg2(id,string.char(169).."159158874PVP [Player Vs Player]"..string.char(169).."000255000[On]")	 return 1 else pvps[id] = "OFF" pvp[id] = 0 msg2(id,string.char(169).."159158874PVP [Player Vs Player]"..string.char(169).."255000000[Off]")	 return 1	 end		 end if cmd == "!pos" then if player(pa,"exists") then msg2(id,string.char(169).."000255000TileX:"..player(pa,"tilex").." TileY:"..player(pa,"tiley")) msg2(id,string.char(169).."000255000X:"..player(pa,"x").." Y:"..player(pa,"y")) return 1 else msg2(id,"Player "..pa.." not exist") return 1 end end if cmd == "!mypos" then msg2(id,string.char(169).."000255000TileX:"..player(id,"tilex").." TileY:"..player(id,"tiley")) msg2(id,string.char(169).."000255000X:"..player(id,"x").." Y:"..player(id,"y")) return 1 end if (Radio.IsBroadcasting[id]==false) then local text = string.format("000255000[Proximity] "..string.char(169).."000155255", player(id, "name"), txt) text = ""..string.char(169).."000255000[Proximity] "..string.char(169).."000155255" .. player(id, "name") .. " "..string.char(169).."255255000: " .. txt .. " . " radiusmsg(text, player(id, 'x'), player(id, 'y'), radiusx, radiusy) return 1 end if (Radio.IsBroadcasting[id]) then if (Radio.Frequency[id]==0) then for pl=1,32 do if (player(pl,"exists") and Radio.IsZeroBlocked[pl]==false) then msg2(pl,string.char(169).."084255159[GLOBAL] "..string.char(169).."000155255"..player(id,"name").." "..string.char(169).."255255000: "..txt..".") end end print(player(id,"name").." (RADIO): "..txt) return 1 elseif (Radio.Frequency[id]>0 and Radio.Frequency[id]<=100) then msg2(id,player(id,"name").." (RADIO FQ "..Radio.Frequency[id].."): "..txt) for pl=1,32 do if (player(pl,"exists") and Radio.Frequency[pl]==Radio.Frequency[id] and pl~=id) then msg2(pl,player(id,"name").." (RADIO FQ "..Radio.Frequency[id].."): "..txt) end end print(player(id,"name").." (RADIO FQ "..Radio.Frequency[id].."): "..txt) return 1 elseif (Radio.Frequency[id]>100) then msg2(id,player(id,"name").." (RADIO FQ "..Radio.Frequency[id].."): "..txt) msg2(Radio.Frequency[id]-100,player(id,"name").." (RADIO FQ "..Radio.Frequency[id].."): "..txt) print(player(id,"name").." (RADIO FQ "..Radio.Frequency[id].."): "..txt) return 1 end end if (Radio.IsChangingFq[id]) then local fq=tonumber(t:sub(1,2)) if (fq~=nil and fq>=0 and fq<=132) then Radio.Frequency[id]=tonumber(t:sub(1,3)) msg2(id,"Your radio frequency is now "..Radio.Frequency[id]) Radio.IsChangingFq[id]=false return 1 end end end Radio={} function initArray2(f,v) local cmd = {} for c = 1, f do 	cmd[c] = v end return cmd end function initArray3(f,x,v) local cmd = {} for c = 1, f do 	cmd[c] = {x,v} end return cmd end Radio.Frequency=initArray2(32,0) Radio.IsChangingFq=initArray2(32,false) Radio.IsBroadcasting=initArray2(32,false) Radio.IsZeroBlocked=initArray2(32,false) function Radio.Menu(id) if (Radio.IsBroadcasting[id]==false) then if not (Radio.IsZeroBlocked[id]) then menu(id,"Change you Speak,,Speak [GLOBAL]") else menu(id,"Change you Speak,,Speak [GLOBAL]") end else menu(id,"Change you Speak,,Speak [Proximity]") end end
healt_config.lua
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
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
-- [[ More Health By HaRe ]] -- -- [[ Edited By Lucas_SWAT#83781 ]] -- -- [[ SafeZone By Engin33r ]] -- dofile("sys/lua/CF/mods/safezone/config.cfg") function inSafezone(id) 	local tilex = player(id,"tilex"); 	local tiley = player(id,"tiley"); 	for _, i in pairs(safezones) do 		if (tilex >= i[1][1] and tilex <= i[2][1]) and (tiley >= i[1][2] and tiley <= i[2][2]) then 			return true; 		end 	end 	return false; end addhook("movetile", "onMovetile") function onMovetile(id,x,y) 	if inSafezone(id) then 		parse('hudtxt2 '..id..' 11 "©150255000SAFE ZONE" 320 200 1'); 	elseif not inSafezone(id) then 		parse('hudtxt2 '..id..' 11 ""'); 	end end function initArray(m) 	local array = {} 	for i = 1, m do 		array[i]=0 	end 	return array 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 if PVP == nil then PVP = {} end if pvp == nil then pvp = {}	end for USA = 1,32 do pvp[USA] = 0 end addhook("hit","ehealth_hit") function ehealth_hit(id,source,weapon,hpdmg,apdmg) 	 if ehealth[id]>1 and (player(id,"team") == 2) and (player(source,"team") == 2) and not inSafezone(id) and not inSafezone(source) then 		if (pvp[source] == 1) and (pvp[id] == 1) and not inSafezone(id) and not inSafezone(source) then 		ehealth[id]=ehealth[id]-hpdmg 		return 1 		end 		if (pvp[id] == 1) and (pvp[source] == 1) and not inSafezone(id) and not inSafezone(source) then 		ehealth[id]=ehealth[id]-hpdmg 		return 1 		end 	elseif ehealth[id]>1 and (player(id,"team") == 2) and (player(source,"team") == 1) and not inSafezone(id) and not inSafezone(source) then 		ehealth[id]=ehealth[id]-hpdmg 		return 1 	elseif ehealth[id]>1 and (player(id,"team") == 1) and (player(source,"team") == 2) and not inSafezone(id) and not inSafezone(source) then 		ehealth[id]=ehealth[id]-hpdmg 		return 1 	elseif ehealth[id]>1 and (player(id,"team") == 2) and (player(source,"team") == 1) and not inSafezone(id) and not inSafezone(source) then 		ehealth[id]=ehealth[id]-hpdmg 	elseif ehealth[id]>1 and (player(id,"team") == 2) and (player(source,"team") == 2) and not inSafezone(id) and not inSafezone(source) then 		ehealth[id]=ehealth[id]-hpdmg 	elseif ehealth[id]>1 and (player(id,"team") == 1) and (player(source,"team") == 2) and not inSafezone(id) and not inSafezone(source) then 		ehealth[id]=ehealth[id]-hpdmg 	 end if (pvp[source]== 1) and (pvp[id]== 0) then if (player(id,"team") == 2) and (player(source,"team") == 2) then return 1	 	end 	end 	if (pvp[source]== 0) and (pvp[id]== 1) then if (player(id,"team") == 2) and (player(source,"team") == 2) then return 1	 	end 	end 	if (pvp[source]== 0) and (pvp[id]== 0) then if (player(id,"team") == 2) and (player(source,"team") == 2) then return 1	 	end 	end 	if (pvp[id]== 0) and (pvp[source]== 0) then if (player(id,"team") == 2) and (player(source,"team") == 2) then return 1	 	end 	end 	if inSafezone(id) then 		return 1; 	elseif inSafezone(source) then 		return 1; 	end 	end addhook("ms100","ehealth_hud") function ehealth_hud() 	for id = 1,32 do 		if (player(id,"exists")) and (minute<10) then 			parse('hudtxt2 '..id..' 1 "©000500000Health: '..ehealth[id]..' ©128255128PVP:©255255000 '..pvps[id]..' ©255000000'..hour..':'..minute..' '..ampm..'" 8 418') 		else 			parse('hudtxt2 '..id..' 1 "©000500000Health: '..ehealth[id]..' ©128255128PVP:©255255000'..pvps[id]..' ©255000000'..hour..':'..minute..' '..ampm..'" 8 418') 		end 	end end addhook("ms100","ehealth_ms100") function ehealth_ms100() 	for id = 1,32 do 		msh[id]=msh[id]+1 		if not player(id,"bot") then 		if (player(id,"exists")) and msh[id]==1 then 			msh[id]=2 			ehealth[id]=300 		 end 	 end end end addhook("ms100","ehealth_check") function ehealth_check() 	for id = 1,32 do 		if (player(id,"exists")) then 			if (player(id,"health")>100) then 				parse("setmaxhealth "..id.." 100") 			end 		end 	end end
Sorry for bad english. :]