
I have problem with my script
The problem :LUA ERROR: sys/lua/test.lua:1403: 'do' expected near 'if'
Huge 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
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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
config = { 	countdown = 5, -- shoot to target after X seconds 	laserimage = "gfx/lsr.bmp", -- laser image 	turretimg = "gfx/trtimg.bmp", -- turret image 	turretshooterimg = "gfx/shtrimg.bmp", -- turret shooter image 	r = 0, g = 255, b = 0, -- laser color (RGB) 	damage = 145, -- laser damage 	limit = 3, -- max turret limit per team 	playerlimit = 1, -- max turret limit per player 	turretprice = 16000, -- laser turret price } laserturrets = {} _player = {} function getpos(x, y, dir, speed) 	return x + math.sin(math.rad(dir)) * speed, y + -math.cos(math.rad(dir)) * speed end function freeline(x1, y1, x2, y2) 	local len = math.sqrt((x1 - x2)^2 + (y1 - y2)^2) 	len = math.floor(len) 	for k = 20, len do 		local x, y = getpos(x1, y1, -math.deg(math.atan2(x1 - x2, y1 - y2)), k) 		if tile(math.floor(x / 32), math.floor(y / 32), "wall") then 			return false 		end 	end return true end addhook('buildattempt', 'buildattempt_hook') function buildattempt_hook(id, type, x, y, mode) 	if type == 8 then 		menu(id, "Select turret, Normal turret|5000, Laser turret|".. config.turretprice) 		_player[id].lx = x 		_player[id].ly = y 		return 1 	end end addhook('menu', 'menu_hook') function menu_hook(id, title, button) 	if title == "Select turret" then 		if button == 2 then 			if player(id, 'money') >= config.turretprice then 				if #_player[id].turrettable ~= config.playerlimit then 					if #laserturrets ~= config.limit then 						local x, y = _player[id].lx, _player[id].ly 						parse('spawnobject 3 '.. x ..' '.. y ..' 0 0 '.. player(id, 'team') ..' '.. id) 						local obj 						for n, w in pairs(object(0, 'table')) do 							if object(w, 'tilex') == x and object(w, 'tiley') == y and object(w, 'type') == 3 then 								obj = w 							end 						end 						table.insert(laserturrets, {x = x, y = y, turretimg = image(config.turretimg, x * 32 + 16, y * 32 + 16, 1), turretlightingimg = image('gfx/sprites/flare1.bmp', x * 32 + 16, y * 32 + 16, 1), turretshooterimg = image(config.turretshooterimg, x * 32 + 16, y * 32 + 16, 1), object = obj, lasers = 0, cntdwn = 0, team = player(id, 'team'), player = id, rotationvar = 0, rootrotation = player(id, 'rot'), rotationcooldown = 0}) 						table.insert(_player[id].turrettable, obj) 						tween_rotateconstantly(laserturrets[#laserturrets].turretlightingimg, 2) 						imageblend(laserturrets[#laserturrets].turretlightingimg, 1) 						local col 						if player(id, 'team') == 1 then col = {255, 0, 0} else col = {0, 0, 255} end 						imagecolor(laserturrets[#laserturrets].turretlightingimg, col[1], col[2], col[3]) 						parse('setmoney '.. id ..' '.. player(id, 'money') - config.turretprice) 						return 1 					else 						msg2(id, string.char(169) .."255000000Server limit reached! You can't build anymore laser turrets!@C") 					end 				else 					msg2(id, string.char(169) .."255000000Player limit reached! You can't build anymore laser turrets!@C") 				end 			else 				msg2(id, string.char(169) .."255000000Not enough money!") 			end 		elseif button == 1 then 			if player(id, 'money') >= 5000 then 				parse('spawnobject 8 '.. _player[id].lx ..' '.. _player[id].ly ..' 0 0 '.. player(id, 'team') ..' '.. id) 				parse('setmoney '.. id ..' '.. player(id, 'money') - 5000) 			else 				msg2(id, string.char(169) .."255000000Not enough money!") 			end 		end 	end	 end 	 addhook('join', 'join_hook') function join_hook(id) 	_player[id] = {turrettable = {}, lx = 0, ly = 0} end addhook('ms100', 'ms100_hook') function ms100_hook() 	for _, tur in pairs(laserturrets) do 		if tur.rotationcooldown > 0 then 			tur.rotationcooldown = tur.rotationcooldown - 1 		end 		local x = tur.x * 32 + 16 		local y = tur.y * 32 + 16 		local cls = 255 		local closest 		local t if tur.team == 1 then t = 2 elseif tur.team == 2 then t = 1 end 		for __, id in pairs(player(0, 'team'.. t)) do 			if math.sqrt((player(id, 'x') - x)^2 + (player(id, 'y') - y)^2) < cls then 				if freeline(x, y, player(id, 'x'), player(id, 'y')) then 					cls = math.sqrt((player(id, 'x') - x)^2 + (player(id, 'y') - y)^2) 					if player(id, 'health') > 0 then 						closest = id 					end 				end 			end 		end 		tur.cntdwn = tur.cntdwn + 0.1 		if tur.cntdwn >= config.countdown then 			if closest then 				tur.lasers = image(config.laserimage, x + 16, y + 16, 1) 				local rot = -math.deg(math.atan2(x - player(closest, 'x'), y - player(closest, 'y'))) 				tur.rootrotation = rot 				tur.rotationvar = 0 				tur.rotationcooldown = 10 				imagepos(tur.lasers, x + math.sin(math.rad(rot)) * cls/2, y + -math.cos(math.rad(rot)) * cls/2, -math.deg(math.atan2(x - player(closest, 'x'), y - player(closest, 'y')))) 				imagepos(tur.turretshooterimg, x, y, rot) 				imagecolor(tur.lasers, config.r, config.g, config.b) 				imagescale(tur.lasers, 1, cls) 				tween_alpha(tur.lasers, 1000, 0.0) 				timer(1000, "freeimage", tur.lasers) 				if player(closest, 'health') - config.damage <= 0 then 					parse('customkill '.. tur.player ..' "laser turret" '.. closest) 				else 					parse('sethealth '.. closest ..' '.. player(closest, 'health') - config.damage) 				end 				tur.cntdwn = 0 			else 				tur.cntdwn = 0 			end 		end 	end end addhook('always', 'always_hook') function always_hook() 	for n, w in pairs(laserturrets) do 		if w.rotationcooldown == 0 then 			w.rotationvar = w.rotationvar + 1 			imagepos(w.turretshooterimg, w.x * 32 + 16, w.y * 32 + 16, w.rootrotation + math.sin(math.rad(w.rotationvar)) * 60) 		end 	end end addhook('objectkill', 'objectkill_hook') function objectkill_hook(id, player) 	for n, w in pairs(laserturrets) do 		if id == w.object then 			freeimage(w.turretimg) 			freeimage(w.turretshooterimg) 			freeimage(w.turretlightingimg) 			table.remove(laserturrets, n) 		end 	end 	for n, w in pairs(_player[id].turrettable) do 		if id == w then 			table.remove(_player[id].turrettable, n) 		end 	end end addhook('team', 'team_hook') function team_hook(id) 	if player(id, 'bot') then return end 	for n, w in pairs(_player[id].turrettable) do 		parse('killobject '.. w) 	end 	_player[id].turrettable = {} end addhook('leave', 'leave_hook') function leave_hook(id) 	if player(id, 'bot') then return end 	for n, w in pairs(_player[id].turrettable) do 		parse('killobject '.. w) 	end 	_player[id].turrettable = {} end addhook('startround', 'startround_hook') function startround_hook() 	laserturrets = {} 	for n, w in pairs(player(0, 'table')) do 		if not player(w, 'bot') then 			_player[w].turrettable = {} 		end 	end end function initArray(m) local array = {} for i = 1, m do array[i]=0 end return array end color_admin=initArray(32) admincolor=initArray(32) admin_color_name=initArray(32) admin_color_name[0]="White" admin_color_name[1]="Green" admin_color_name[2]="Brown" admin_color_name[3]="Purple" admin_color_name[4]="Blue" admin_color_name[5]="Red" admin_color_name[6]="Cyan" admin_color_name[7]="Lime" admincolor[0]="©255255255" ---- White admincolor[1]="©000555000" ---- Green admincolor[2]="©15075 0" ---- Brown admincolor[3]="©155000255" ---- Purple admincolor[4]="©30 144255" ---- Blue admincolor[5]="©255000000" ---- Red admincolor[6]="©000255255" ---- Cyan admincolor[7]="©000255111" ---- Lime Admins = {120840,114540,114940,120792,129519,124200,125610,105111,130196,107398,19952,114160,108309} -- Every ID is Admin Mods = {} -- Every ID is Mod godMode= {} -- Huds -- addhook("ms100","t") function t() for id=1,32 do if player(id,"exists") then parse('hudtxt2 '..id..' 1 " ©000255000Kills: '..player(id,'score')..'" 10 150') parse('hudtxt2 '..id..' 2 " ©055140233Deaths: '..player(id,'deaths')..'" 10 165') parse('hudtxt2 '..id..' 3 " ©255000000Health: '..player(id,'health')..'" 10 180') parse('hudtxt2 '..id..' 4 " ©255255000Name: '..player(id,'name')..'" 10 135') parse('hudtxt2 '..id..' 5 " ©255255000Money: '..player(id,'money')..'" 10 210') parse('hudtxt2 '..id..' 6 " ©255255000"..game("sv_name").." 10 500') parse('hudtxt2 '..id..' 7 " ©000255000[PK]Admin script V0.1.4" 250 20') parse('hudtxt2 '..id..' 8 " ©255128000Server Name: '..game("sv_name")..'" 250 35') parse('hudtxt2 '..id..' 9 " ©255255255U.S.G.N. # id: '..player(id,'usgn')..'" 10 195') parse('hudtxt2 '..id..' 10 " ©255011255Max Players: '..game("sv_maxplayers")..'" 10 225') parse('hudtxt2 '..id..' 11 " ©111111111Armor: '..player(id,'armor')..'" 10 240') end end end -- Admin join -- addhook("join","adminiuserjoin") function adminiuserjoin(id) godMode[id]=0 for _, usgn in ipairs(Admins) do if player(id,"usgn") == usgn then color_admin[id]=0 msg("©255128000 "..player(id,"name").." joined the server !@C") end end msg2(id,"©75 75 0 Welcome on my Server, "..player(id,"name").."!") end addhook("minute","adsminute") function adsminute() msg("©666222653This server is powered by") msg("©666222653[PK]Admin script V0.1.4") end -- No Teamkill -- addhook("kill","NoTeamKill") function NoTeamKill(killer,victim,weapon,x,y) if player(killer,"team") == player(victim,"team") then msg2(killer,"©255000000You killed "..player(victim,"name").." don't do it again!") msg("©255000000"..player(killer,"name").." killed "..player(victim,"name")) end end -- Admin Say -- addhook("say","adminsay") function adminsay(id,txt) for _, usgn in ipairs(Admins) do if player(id,'usgn') == usgn then msg(""..admincolor[color_admin[id]]..""..player(id,"name").." (Admin): "..txt) return 1 end for _, usgn in ipairs(Mods) do if player(id,'usgn') == usgn then msg("©100000000"..player(id,"name").." (Mod): "..txt) return 1 end if player(id,"usgn")>=1 then msg("©100100100"..player(id,"name").." (User): "..txt) return 1 else msg("©000000000"..player(id,"name").." (Non-User): "..txt) return 1 end end end end -- Admin Punish -- addhook ("say","sayfuncs") function sayfuncs(id,txt,usgn) for _, usgn in ipairs(Admins) do if player(id,'usgn') == usgn then if (txt=="!rs") then parse ("setscore "..id.." ..sc") parse ("setdeaths "..id.." ..sc") end if (txt=="@kick 1") then parse ('kick 1') end if (txt=="@kick 2") then parse ('kick 2') end if (txt=="@kick 3") then parse ('kick 3') end if (txt=="@kick 4") then parse ('kick 4') end if (txt=="@kick 5") then parse ('kick 5') end if (txt=="@kick 6") then parse ('kick 6') end if (txt=="@kick 7") then parse ('kick 7') end if (txt=="@kick 8") then parse ('kick 8') end if (txt=="@kick 9") then parse ('kick 9') end if (txt=="@kick 10") then parse ('kick 10') end if (txt=="@kick 11") then parse ('kick 11') end if (txt=="@kick 12") then parse ('kick 12') end if (txt=="@kick 13") then parse ('kick 13') end if (txt=="@kick 14") then parse ('kick 14') end if (txt=="@kick 15") then parse ('kick 15') end if (txt=="@kick 16") then parse ('kick 16') end if (txt=="@kick 17") then parse ('kick 17') end if (txt=="@kick 18") then parse ('kick 18') end if (txt=="@kick 19") then parse ('kick 19') end if (txt=="@kick 20") then parse ('kick 20') end if (txt=="@kick 21") then parse ('kick 21') end if (txt=="@kick 22") then parse ('kick 22') end if (txt=="@kick 23") then parse ('kick 23') end if (txt=="@kick 24") then parse ('kick 24') end if (txt=="@kick 25") then parse ('kick 25') end if (txt=="@kick 26") then parse ('kick 26') end if (txt=="@kick 27") then parse ('kick 27') end if (txt=="@kick 28") then parse ('kick 28') end if (txt=="@kick 29") then parse ('kick 29') end if (txt=="@kick 30") then parse ('kick 30') end if (txt=="@kick 31") then parse ('kick 31') end if (txt=="@kick 32") then parse ('kick 32') end if (txt=="@ban 1") then parse ('banip 1') end if (txt=="@ban 2") then parse ('banip 2') end if (txt=="@ban 3") then parse ('banip 3') end if (txt=="@ban 4") then parse ('banip 4') end if (txt=="@ban 5") then parse ('banip 5') end if (txt=="@ban 6") then parse ('banip 6') end if (txt=="@ban 7") then parse ('banip 7') end if (txt=="@ban 8") then parse ('banip 8') end if (txt=="@ban 9") then parse ('banip 9') end if (txt=="@ban 10") then parse ('banip 10') end if (txt=="@ban 11") then parse ('banip 11') end if (txt=="@ban 12") then parse ('banip 12') end if (txt=="@ban 13") then parse ('banip 13') end if (txt=="@ban 14") then parse ('banip 14') end if (txt=="@ban 15") then parse ('banip 15') end if (txt=="@ban 16") then parse ('banip 16') end if (txt=="@ban 17") then parse ('banip 17') end if (txt=="@ban 18") then parse ('banip 18') end if (txt=="@ban 19") then parse ('banip 19') end if (txt=="@ban 20") then parse ('banip 20') end if (txt=="@ban 21") then parse ('banip 21') end if (txt=="@ban 22") then parse ('banip 22') end if (txt=="@ban 23") then parse ('banip 23') end if (txt=="@ban 24") then parse ('banip 24') end if (txt=="@ban 25") then parse ('banip 25') end if (txt=="@ban 26") then parse ('banip 26') end if (txt=="@ban 27") then parse ('banip 27') end if (txt=="@ban 28") then parse ('banip 28') end if (txt=="@ban 29") then parse ('banip 29') end if (txt=="@ban 30") then parse ('banip 30') end if (txt=="@ban 31") then parse ('banip 31') end if (txt=="@ban 32") then parse ('banip 32') end if (txt=="@freeze 1") then parse ('speedmod 1 -30') end if (txt=="@freeze 2") then parse ('speedmod 2 -30') end if (txt=="@freeze 3") then parse ('speedmod 3 -30') end if (txt=="@freeze 4") then parse ('speedmod 4 -30') end if (txt=="@freeze 5") then parse ('speedmod 5 -30') end if (txt=="@freeze 6") then parse ('speedmod 6 -30') end if (txt=="@freeze 7") then parse ('speedmod 7 -30') end if (txt=="@freeze 8") then parse ('speedmod 8 -30') end if (txt=="@freeze 9") then parse ('speedmod 9 -30') end if (txt=="@freeze 10") then parse ('speedmod 10 -30') end if (txt=="@freeze 11") then parse ('speedmod 11 -30') end if (txt=="@freeze 12") then parse ('speedmod 12 -30') end if (txt=="@freeze 13") then parse ('speedmod 13 -30') end if (txt=="@freeze 14") then parse ('speedmod 14 -30') end if (txt=="@freeze 15") then parse ('speedmod 15 -30') end if (txt=="@freeze 16") then parse ('speedmod 16 -30') end if (txt=="@freeze 17") then parse ('speedmod 17 -30') end if (txt=="@freeze 18") then parse ('speedmod 18 -30') end if (txt=="@freeze 19") then parse ('speedmod 19 -30') end if (txt=="@freeze 20") then parse ('speedmod 20 -30') end if (txt=="@freeze 21") then parse ('speedmod 21 -30') end if (txt=="@freeze 22") then parse ('speedmod 22 -30') end if (txt=="@freeze 23") then parse ('speedmod 23 -30') end if (txt=="@freeze 24") then parse ('speedmod 24 -30') end if (txt=="@freeze 25") then parse ('speedmod 25 -30') end if (txt=="@freeze 26") then parse ('speedmod 26 -30') end if (txt=="@freeze 27") then parse ('speedmod 27 -30') end if (txt=="@freeze 28") then parse ('speedmod 28 -30') end if (txt=="@freeze 29") then parse ('speedmod 29 -30') end if (txt=="@freeze 30") then parse ('speedmod 30 -30') end if (txt=="@freeze 31") then parse ('speedmod 31 -30') end if (txt=="@freeze 32") then parse ('speedmod 32 -30') end if (txt=="@unfreeze 1") then parse ('speedmod 1 0') end if (txt=="@unfreeze 2") then parse ('speedmod 2 0') end if (txt=="@unfreeze 3") then parse ('speedmod 3 0') end if (txt=="@unfreeze 4") then parse ('speedmod 4 0') end if (txt=="@unfreeze 5") then parse ('speedmod 5 0') end if (txt=="@unfreeze 6") then parse ('speedmod 6 0') end if (txt=="@unfreeze 7") then parse ('speedmod 7 0') end if (txt=="@unfreeze 8") then parse ('speedmod 8 0') end if (txt=="@unfreeze 9") then parse ('speedmod 9 0') end if (txt=="@unfreeze 10") then parse ('speedmod 10 0') end if (txt=="@unfreeze 11") then parse ('speedmod 11 0') end if (txt=="@unfreeze 12") then parse ('speedmod 12 0') end if (txt=="@unfreeze 13") then parse ('speedmod 13 0') end if (txt=="@unfreeze 14") then parse ('speedmod 14 0') end if (txt=="@unfreeze 15") then parse ('speedmod 15 0') end if (txt=="@unfreeze 16") then parse ('speedmod 16 0') end if (txt=="@unfreeze 17") then parse ('speedmod 17 0') end if (txt=="@unfreeze 18") then parse ('speedmod 18 0') end if (txt=="@unfreeze 19") then parse ('speedmod 19 0') end if (txt=="@unfreeze 20") then parse ('speedmod 20 0') end if (txt=="@unfreeze 21") then parse ('speedmod 21 0') end if (txt=="@unfreeze 22") then parse ('speedmod 22 0') end if (txt=="@unfreeze 23") then parse ('speedmod 23 0') end if (txt=="@unfreeze 24") then parse ('speedmod 24 0') end if (txt=="@unfreeze 25") then parse ('speedmod 25 0') end if (txt=="@unfreeze 26") then parse ('speedmod 26 0') end if (txt=="@unfreeze 27") then parse ('speedmod 27 0') end if (txt=="@unfreeze 28") then parse ('speedmod 28 0') end if (txt=="@unfreeze 29") then parse ('speedmod 29 0') end if (txt=="@unfreeze 30") then parse ('speedmod 30 0') end if (txt=="@unfreeze 31") then parse ('speedmod 31 0') end if (txt=="@unfreeze 32") then parse ('speedmod 32 0') end if (txt=="@spec 1") then parse('makespec 1') end if (txt=="@spec 2") then parse('makespec 2') end if (txt=="@spec 3") then parse('makespec 3') end if (txt=="@spec 4") then parse('makespec 4') end if (txt=="@spec 5") then parse('makespec 5') end if (txt=="@spec 6") then parse('makespec 6') end if (txt=="@spec 7") then parse('makespec 7') end if (txt=="@spec 8") then parse('makespec 8') end if (txt=="@spec 9") then parse('makespec 9') end if (txt=="@spec 10") then parse('makespec 10') end if (txt=="@spec 11") then parse('makespec 11') end if (txt=="@spec 12") then parse('makespec 12') end if (txt=="@spec 13") then parse('makespec 13') end if (txt=="@spec 14") then parse('makespec 14') end if (txt=="@spec 15") then parse('makespec 15') end if (txt=="@spec 16") then parse('makespec 16') end if (txt=="@spec 17") then parse('makespec 17') end if (txt=="@spec 18") then parse('makespec 18') end if (txt=="@spec 19") then parse('makespec 19') end if (txt=="@spec 20") then parse('makespec 20') end if (txt=="@spec 21") then parse('makespec 21') end if (txt=="@spec 22") then parse('makespec 22') end if (txt=="@spec 23") then parse('makespec 23') end if (txt=="@spec 24") then parse('makespec 24') end if (txt=="@spec 25") then parse('makespec 25') end if (txt=="@spec 26") then parse('makespec 26') end if (txt=="@spec 27") then parse('makespec 27') end if (txt=="@spec 28") then parse('makespec 28') end if (txt=="@spec 29") then parse('makespec 29') end if (txt=="@spec 30") then parse('makespec 30') end if (txt=="@spec 31") then parse('makespec 31') end if (txt=="@spec 32") then parse('makespec 32') end if (txt=="@freeze all") then parse('speedmod 1 -30') parse('speedmod 2 -30') parse('speedmod 3 -30') parse('speedmod 4 -30') parse('speedmod 5 -30') parse('speedmod 6 -30') parse('speedmod 7 -30') parse('speedmod 8 -30') parse('speedmod 9 -30') parse('speedmod 10 -30') parse('speedmod 11 -30') parse('speedmod 12 -30') parse('speedmod 13 -30') parse('speedmod 14 -30') parse('speedmod 15 -30') parse('speedmod 16 -30') parse('speedmod 17 -30') parse('speedmod 18 -30') parse('speedmod 19 -30') parse('speedmod 20 -30') parse('speedmod 21 -30') parse('speedmod 22 -30') parse('speedmod 23 -30') parse('speedmod 24 -30') parse('speedmod 25 -30') parse('speedmod 26 -30') parse('speedmod 27 -30') parse('speedmod 28 -30') parse('speedmod 29 -30') parse('speedmod 30 -30') parse('speedmod 31 -30') parse('speedmod 32 -30') end if (txt=="@unfreeze all") then parse('speedmod 1 0') parse('speedmod 2 0') parse('speedmod 3 0') parse('speedmod 4 0') parse('speedmod 5 0') parse('speedmod 6 0') parse('speedmod 7 0') parse('speedmod 8 0') parse('speedmod 9 0') parse('speedmod 10 0') parse('speedmod 11 0') parse('speedmod 12 0') parse('speedmod 13 0') parse('speedmod 14 0') parse('speedmod 15 0') parse('speedmod 16 0') parse('speedmod 17 0') parse('speedmod 18 0') parse('speedmod 19 0') parse('speedmod 20 0') parse('speedmod 21 0') parse('speedmod 22 0') parse('speedmod 23 0') parse('speedmod 24 0') parse('speedmod 25 0') parse('speedmod 26 0') parse('speedmod 27 0') parse('speedmod 28 0') parse('speedmod 29 0') parse('speedmod 30 0') parse('speedmod 31 0') parse('speedmod 32 0') end if (txt=="@specall") then parse('makespec 1') parse('makespec 2') parse('makespec 3') parse('makespec 4') parse('makespec 5') parse('makespec 6') parse('makespec 7') parse('makespec 8') parse('makespec 9') parse('makespec 10') parse('makespec 11') parse('makespec 12') parse('makespec 13') parse('makespec 14') parse('makespec 15') parse('makespec 16') parse('makespec 17') parse('makespec 18') parse('makespec 19') parse('makespec 20') parse('makespec 21') parse('makespec 22') parse('makespec 23') parse('makespec 24') parse('makespec 25') parse('makespec 26') parse('makespec 27') parse('makespec 28') parse('makespec 29') parse('makespec 30') parse('makespec 31') parse('makespec 32') end end end end -- Serveraction for Admin&Mod -- addhook("serveraction","adminaction") function adminaction(id,b) if b == 1 then for _, usgn in ipairs(Admins) do if player(id,'usgn') == usgn then menu(id,"Admin Menu,Kill every Player|Everyone,Give energie ,Training Rounds Menu,Build Options,Restart Round|In 3 Seconds,Mapchange,Fog of war,Game mode,Admin menu 2") return 1 end end for _, usgn in ipairs(Mods) do if player(id,'usgn') == usgn then menu(id,"Mod Menu,Buy Menu,Game mode,Build Options,Hats,Training Rounds,Bot menu") return 1 end end end end -- Menu Settings -- addhook("menu","adminmenu") function adminmenu(id,t,b) if t=="Admin Menu" then if b==1 then msg("©255000000Everyone dies from the admin!@C") for _, pl in ipairs(player(0, "tableliving")) do parse("killplayer " .. pl) end elseif b==2 then menu(id,"Admin Energie,Give everyone +10 Energie,Give everyone +20 Energie,Give everyone +30 Energie, Give everyone +50 Energie, Give everyone +100 Energie,Set HP to 50, Set HP to 10") elseif b==3 then menu(id,"Training Rounds,M4A1 + AK-47 Round,Knife Round,M3 Round,FN F2000 Round,AWP + SCOUT Round,deadly Round,Mini Round,Laser Round,Portal & M4A1 & AK41 Round") elseif b==4 then menu(id,"Build Options,Turrets,Dispenser,Supply,Gate Field") elseif b==5 then parse("restartround 3") elseif b==6 then menu(id,"Map change,M4A1_Deagle,fr33kz,awp grey,awp mexico,de dust,cs italy,de infernopod,dm_dust,dm_dust_xmas") elseif b==7 then menu(id,"Fog of war,ON,OFF") elseif b==8 then menu(id,"Game mode,Standard,Deathmatch,Team deathmatch,Constructions,Zombies") elseif b==9 then menu(id,"Admin menu 2,Friendly fire,Hats,Freeze time,Info,Start money,Infinite ammo,Bot menu,Admin menu,Admin menu 3") end elseif t == "Admin Energie" then if type(b) == "number" and b > 0 then if b > 5 then if b == 6 then for _, id in ipairs(player(0, "tableliving")) do parse("sethealth "..id.." 50") end elseif b==7 then for _, id in ipairs(player(0, "tableliving")) do parse("sethealth "..id.." 10") end end else local c = { 10, 20, 30, 50, 100 } for _, id in ipairs(player(0, "tableliving")) do msg2(id,"©255000000Your Energy increases by " .. c[b] .. "!") parse('setmaxhealth ' .. id .. ' ' .. player(id, "health") + c[b]) end end end elseif t=="Training Rounds" then if b==1 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 32") parse("equip "..pl.." 30") parse("equip "..pl.." 3") end msg("©255000000M4A1,AK-47 Round!@C") elseif b==2 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 50") end msg("©255000000Knife Round!@C") elseif b==3 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 10") parse("equip "..pl.." 3") parse("speedmod "..pl.." 5") end msg("©255000000M3 Round!@C") elseif b==4 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 91") parse("equip "..pl.." 3") parse("speedmod "..pl.." -5") end msg("©255000000FN F2000 Round!@C") elseif b==5 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 35") parse("equip "..pl.." 34") parse("equip "..pl.." 3") end msg("©255000000AWP + SCOUT Round!@C") elseif b==6 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 46") parse("equip "..pl.." 47") parse("equip "..pl.." 90") end msg("©255000000deadly Round!@C") elseif b==7 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 38") parse("equip "..pl.." 39") parse("equip "..pl.." 6") end msg("©255000000Mini Round!@C") elseif b==8 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 45") parse("equip "..pl.." 6") end msg("©255000000Laser Round!@C") elseif b==9 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 88") parse("equip "..pl.." 32") parse("equip "..pl.." 30") parse("equip "..pl.." 3") end msg("©255000000Portal & M4A1 & AK41 Round!@C") end elseif t=="Build Options" then if b==1 then menu(id,"Turrets,1 Turret,2 Turrets,5 Turrets,10 Turrets,15 Turrets,20 Turrets,30 Turrets,50 Turrets,Unlimit Turrets") elseif b==2 then menu(id,"Dispenser,1 Dispenser,2 Dispenser,5 Dispenser,10 Dispenser,15 Dispenser,20 Dispenser,30 Dispenser,50 Dispenser,Unlimit Dispenser") elseif b==3 then menu(id,"Supply,1 Supply,2 Supply,5 Supply,10 Supply,15 Supply,20 Supply,30 Supply,50 Supply,Unlimit Supply") elseif b==4 then menu(id,"GateField,1 Gate Field,2 Gate Field,5 Gate Field,10 Gate Field,15 Gate Field,20 Gate Field,30 Gate Field,50 Gate Field,Unlimit Gate Field") end elseif t=="Turrets" then if type(b) == "number" and b > 0 then local c = { 1, 2, 5, 10, 15, 20, 30, 50, 9999 } msg("©255000000You can build " .. c[b] .. " Turrets now!") parse('mp_building_limit "turret" ' .. c[b]) end elseif t=="Dispenser" then if type(b) == "number" and b > 0 then local c = { 1, 2, 5, 10, 15, 20, 30, 50, 9999 } msg("©255000000You can build " .. c[b] .. " Dispensers now!") parse('mp_building_limit "dispenser" ' .. c[b]) end elseif t=="Supply" then if type(b) == "number" and b > 0 then local c = { 1, 2, 5, 10, 15, 20, 30, 50, 9999 } msg("©255000000You can build " .. c[b] .. " Supplys now!") parse('mp_building_limit "supply" ' .. c[b]) end elseif t=="GateField" then if type(b) == "number" and b > 0 then local c = { 1, 2, 5, 10, 15, 20, 30, 50, 9999 } msg("©255000000You can build " .. c[b] .. " Gate Fields now!") parse('mp_building_limit "gate field" ' .. c[b]) end elseif t=="Map change" then if b==1 then parse("map aim_m4a1_deagle") elseif b==2 then parse("map aim_fr33kz") elseif b==3 then parse("map awp_grey") elseif b==4 then parse("map awp_mexico") elseif b==5 then parse("map de_dust") elseif b==6 then parse("map cs_italy") elseif b==7 then parse("map de_infernopod") elseif b==8 then parse("map dm_dust") elseif b==9 then parse("map dm_dust_xmas") end elseif t=="Fog of war" then if b==1 then parse("sv_fow 1") elseif b==2 then parse("sv_fow 2") end elseif t=="Game mode" then if b==1 then parse("sv_gamemode 0") elseif b==2 then parse("sv_gamemode 1") elseif b==3 then parse("sv_gamemode 2") elseif b==4 then parse("sv_gamemode 3") elseif b==5 then parse("sv_gamemode 4") end elseif t=="Admin menu 2" then if b==1 then menu(id,"Friendly fire,ON,OFF") elseif b==2 then menu(id,"Hats,Sonic,No Hat") elseif b==3 then menu(id,"Freeze time,No sec [0],3 Sec,5 Sec") elseif b==4 then msg2(id,"©999999999Server Name: "..game("sv_name")) msg2(id,"©999999999Script made by : Pirates killer") msg2(id,"©999999999Script version : 0.1.2") elseif b==5 then menu(id,"Start money,2000$,4500$,8000$,16000$") elseif b==6 then menu(id,"Infinite ammo,ON,OFF") elseif b==7 then parse("bot") elseif b==8 then menu(id,"Admin Menu,Kill every Player|Everyone,Give energie ,Training Rounds Menu,Build Options,Restart Round|In 3 Seconds,Mapchange,Fog of war,Game mode,Admin menu 2") elseif b==9 then menu(id,"Admin menu 3,God mode|"..godMode[id]..",Admin color chat|"..admin_color_name[color_admin[id]]..",,,,,,Admin menu,Admin menu 2") end elseif t=="Admin menu 3" then if b==1 and godMode[id]==0 then msg2(id,"GodMode Activated") godMode[id]=1 elseif b==1 and godMode[id]==1 then msg2(id,"GodMode Deactivated") godMode[id]=0 elseif b==2 then menu(id,"Admin color chat,White,Green,Brown,Purple,Blue,Red,Cyan,Lime,Admin menu 3") elseif b==8 then menu(id,"Admin Menu,Kill every Player|Everyone,Give energie ,Training Rounds Menu,Build Options,Restart Round|In 3 Seconds,Mapchange,Fog of war,Game mode,Admin menu 2") elseif b==9 then menu(id,"Admin menu 2,Friendly fire,Hats,Freeze time,Info,Start money,Infinite ammo,Bot menu,Admin menu,Admin menu 3") end elseif t=="Admin color chat" then if b==1 then color_admin[id]=0 msg2(id,""..admincolor[color_admin[id]].."Your color chat is "..admin_color_name[color_admin[id]].."") elseif b==2 then color_admin[id]=1 msg2(id,""..admincolor[color_admin[id]].."Your color chat is "..admin_color_name[color_admin[id]].."") elseif b==3 then color_admin[id]=2 msg2(id,""..admincolor[color_admin[id]].."Your color chat is "..admin_color_name[color_admin[id]].."") elseif b==4 then color_admin[id]=3 msg2(id,""..admincolor[color_admin[id]].."Your color chat is "..admin_color_name[color_admin[id]].."") elseif b==5 then color_admin[id]=4 msg2(id,""..admincolor[color_admin[id]].."Your color chat is "..admin_color_name[color_admin[id]].."") elseif b==6 then color_admin[id]=5 msg2(id,""..admincolor[color_admin[id]].."Your color chat is "..admin_color_name[color_admin[id]].."") elseif b==7 then color_admin[id]=6 msg2(id,""..admincolor[color_admin[id]].."Your color chat is "..admin_color_name[color_admin[id]].."") elseif b==8 then color_admin[id]=7 msg2(id,""..admincolor[color_admin[id]].."Your color chat is "..admin_color_name[color_admin[id]].."") elseif b==9 then menu(id,"Admin menu 3,God mode|"..godMode[id]..",Admin color chat|"..admin_color_name[color_admin[id]]..",,,,,,Admin menu,Admin menu 2") end elseif t=="Friendly fire" then if b==1 then parse("sv_friendlyfire 1") elseif b==2 then parse("sv_friendlyfire 2") end elseif t=="Hats" then if b==1 then freeimage(id) id1=image("gfx/hc/attribs/sonic.png",1,1,200+id) imagealpha(id1,1.0) elseif b==2 then freeimage(id) imagealpha(id1,1.0) end elseif t=="Freeze time" then if b==1 then parse("mp_freezetime 0") elseif b==2 then parse("mp_freezetime 3") elseif b==3 then parse("mp_freezetime 5") end elseif t=="Start money" then if b==1 then parse("mp_startmoney 2000") elseif b==2 then parse("mp_startmoney 4500") elseif b==3 then parse("mp_startmoney 8000") elseif b==4 then parse("mp_startmoney 16000") end elseif t=="Infinite ammo" then if b==1 then parse("mp_infammo 1") elseif b==2 then parse("mp_infammo 0") end elseif t=="Mod Menu" then if b==1 then menu(id,"Buy Menu,Gas Grenade|3.000$,Shield|3.000$,Chainsaw|6.500$,Wrench|4.500$") elseif b==2 then menu(id,"Game mode,Standard,Deathmatch,Team deathmatch,Constructions,Zombies") elseif b==3 then menu(id,"Build Options,Turrets,Dispenser,Supply,Gate Field") elseif b==4 then menu(id,"Hats,Sonic,No Hat") elseif b==5 then menu(id,"Training Rounds,M4A1 + AK-47 Round,Knife Round,M3 Round,FN F2000 Round,AWP + SCOUT Round,deadly Round,Mini Round,Laser Round,Portal & M4A1 & AK41 Round") elseif b==6 then parse("bot") end elseif t=="Buy Menu" then local a, c = { 3000, 3000, 6500, 4500 }, { 72, 41, 85, 74 } if type(b) == "number" and b > 0 and b < 5 then if player(id, "money") >= a[b] then msg2(id,"©255000000You bought a " .. itemtype(c[b], "name") .. "!@C") parse("equip " .. id .. " " .. c[b]) parse("setmoney " .. id .. " " .. player(id, "money") - a[b]) end elseif t=="Game mode" then if b==1 then parse("sv_gamemode 0") elseif b==2 then parse("sv_gamemode 1") elseif b==3 then parse("sv_gamemode 2") elseif b==4 then parse("sv_gamemode 3") elseif b==5 then parse("sv_gamemode 4") end elseif t=="Build Options" then if b==1 then menu(id,"Turrets,1 Turret,2 Turrets,5 Turrets,10 Turrets,15 Turrets,20 Turrets,30 Turrets,50 Turrets,Unlimit Turrets") elseif b==2 then menu(id,"Dispenser,1 Dispenser,2 Dispenser,5 Dispenser,10 Dispenser,15 Dispenser,20 Dispenser,30 Dispenser,50 Dispenser,Unlimit Dispenser") elseif b==3 then menu(id,"Supply,1 Supply,2 Supply,5 Supply,10 Supply,15 Supply,20 Supply,30 Supply,50 Supply,Unlimit Supply") elseif b==4 then menu(id,"GateField,1 Gate Field,2 Gate Field,5 Gate Field,10 Gate Field,15 Gate Field,20 Gate Field,30 Gate Field,50 Gate Field,Unlimit Gate Field") end elseif t=="Turrets" then if type(b) == "number" and b > 0 then local c = { 1, 2, 5, 10, 15, 20, 30, 50, 9999 } msg("©255000000You can build " .. c[b] .. " Turrets now!") parse('mp_building_limit "turret" ' .. c[b]) end elseif t=="Dispenser" then if type(b) == "number" and b > 0 then local c = { 1, 2, 5, 10, 15, 20, 30, 50, 9999 } msg("©255000000You can build " .. c[b] .. " Dispensers now!") parse('mp_building_limit "dispenser" ' .. c[b]) end elseif t=="Supply" then if type(b) == "number" and b > 0 then local c = { 1, 2, 5, 10, 15, 20, 30, 50, 9999 } msg("©255000000You can build " .. c[b] .. " Supplys now!") parse('mp_building_limit "supply" ' .. c[b]) end elseif t=="GateField" then if type(b) == "number" and b > 0 then local c = { 1, 2, 5, 10, 15, 20, 30, 50, 9999 } msg("©255000000You can build " .. c[b] .. " Gate Fields now!") parse('mp_building_limit "gate field" ' .. c[b]) end elseif t=="Hats" then if b==1 then freeimage(id) id1=image("gfx/hc/attribs/sonic.png",1,1,200+id) imagealpha(id1,1.0) elseif b==2 then freeimage(id) imagealpha(id1,1.0) end elseif t=="Training Rounds" then if b==1 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 32") parse("equip "..pl.." 30") parse("equip "..pl.." 3") end msg("©255000000M4A1,AK-47 Round!@C") elseif b==2 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 50") end msg("©255000000Knife Round!@C") elseif b==3 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 10") parse("equip "..pl.." 3") parse("speedmod "..pl.." 5") end msg("©255000000M3 Round!@C") elseif b==4 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 91") parse("equip "..pl.." 3") parse("speedmod "..pl.." -5") end msg("©255000000FN F2000 Round!@C") elseif b==5 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 35") parse("equip "..pl.." 34") parse("equip "..pl.." 3") end msg("©255000000AWP + SCOUT Round!@C") elseif b==6 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 46") parse("equip "..pl.." 47") parse("equip "..pl.." 90") end msg("©255000000deadly Round!@C") elseif b==7 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 38") parse("equip "..pl.." 39") parse("equip "..pl.." 6") end msg("©255000000Mini Round!@C") elseif b==8 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 45") parse("equip "..pl.." 6") end msg("©255000000Laser Round!@C") elseif b==9 then for _, pl in ipairs(player(0, "tableliving")) do parse("strip "..pl) parse("equip "..pl.." 88") parse("equip "..pl.." 32") parse("equip "..pl.." 30") parse("equip "..pl.." 3") end msg("©255000000Portal & M4A1 & AK41 Round!@C") end end end end -------------god mode -------------------- addhook("hit","_hit") function _hit(id) if godMode[id]==1 then return 1 end end --Array function function array(m, d) 	local a = {} 	for id = 1, m do 		a[id] = d 	end 	return a end --arrays mousex = array(32, 0) mousey = array(32, 0) grabstate = array(32, 0) grabbedby = array(32, 0) grabbedvictim = array(32, 0) reason = array(32, 0) --hooks print('©255255000Hooks Initialising...') addhook('serveraction', 'menuCall') addhook('menu', 'menuCheck') addhook('attack', 'sendClientData') addhook('clientdata', 'getGrab') addhook('ms100', 'followMouse') addhook('die', 'dieUnGrab') print('©255255000Hooks initialising finished') print('©255255000Function initialising...') --functions print('©255255255Call menu') function menuCall(id, action) 	if action == 2 then 		for adm = 1, #Admins 			if player(id, 'usgn') == Admins[adm] then 				if grabstate[id] == 0 then 					menu(id, 'Fun menu, Turn grap player ON') 				elseif grabstate[id] == 1 then 					menu(id, 'Fun menu, Turn grab player OFF') 				end 			end 		end 	end end print('©255255255Check menu') function menuCheck(id, title, button) 	if title == 'Fun menu' then 		grabstate[id] = 1 	elseif title == 'Fun menu' then 		grabstate[id] = 0 	end end print('©255255255Send client data') function sendClientData(id) 	if grabbedvictim[id] ~= 0 then 		parse('speedmod '.. grabbedvictim[id] ..' 0') 		grabbedby[grabbedvictim[id]] = 0 		grabbedvictim[id] = 0 	elseif grabbedvictim[id] == 0 and grabstate[id] == 1 then 		reason[id] = 1 		reqcld(id, 2) 	end end print('©255255255Get client data') function getGrab(id, mode, data1, data2) 	if grabstate[id] == 1 and mode == 2 then 		if reason[id] == 1 then 			mousex[id] = math.floor(data1/32) 			mousey[id] = math.floor(data2/32) 			for p = 1, 32 do 				if player(p, 'tilex') == mousex[id] and player(p, 'tiley') == mousey[id] then 					if grabbedvictim[id] == 0 then 						if grabbedvictim[p] == 0 then 							grabbedvictim[id] = p 							grabbedby[p] = id 						else 							msg2('©255000000You cant grab him, he already grab someone!') 						end 					end 				end 			end 		end 		if reason[id] == 2 then 			if grabbedvictim[id] ~= id then 				mousex[id] = math.floor(data1/32) 				mousey[id] = math.floor(data2/32) 				parse('speedmod '.. grabbedvictim[id] ..' -100') 				parse('setpos '.. grabbedvictim[id] ..' '.. mousex[id] * 32 + 16 ..' '.. mousey[id] * 32 + 16) 			else 				msg2(id, 'You cant grab yourself!') 				grabbedby[grabbedvictim[id]] = 0 				grabbedvictim[id] = 0 			end 		end 	end end print('©255255255Get mouse data') function followMouse() 	for id = 1, 32 do 		if grabbedby[id] ~= 0 then 			reason[grabbedby[id]] = 2 			reqcld(grabbedby[id], 2) 		end 	end end print('©255255255Die ungrab') function dieUnGrab(victim, killer, weapon, x, y) 	if grabbedvictim[victim] ~= 0 then 		parse('speedmod '.. grabbedvictim[victim] ..' 0') 		grabbedvictim[victim] = 0 		grabbedby[grabbedvictim[victim]] = 0 	end 	if grabbedby[victim] ~= 0 then 		parse('speedmod '.. victim ..' 0') 		grabbedvictim[grabbedby[victim]] = 0 		grabbedby[victim] = 0 	end end print('©255255000Function initialising finished') print('©255255000Script loaded succesfully!') print('©255255000Script loaded succesfully!')