-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
1572 lines (1406 loc) · 63.6 KB
/
server.lua
File metadata and controls
1572 lines (1406 loc) · 63.6 KB
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
-- Craquer par Korioz#3310 --
-- Debug + ajout du BanSql par Pots#0106 --
local BanList = {}
local BanListLoad = false
CreateThread(function()
while true do
Wait(1000)
if BanListLoad == false then
loadBanList()
if BanList ~= {} then
BanListLoad = true
end
end
end
end)
CreateThread(function()
while true do
Wait(600000)
if BanListLoad == true then
loadBanList()
end
end
end)
RegisterServerEvent('aopkfgebjzhfpazf77')
AddEventHandler('aopkfgebjzhfpazf77', function(reason,servertarget)
local license,identifier,liveid,xblid,discord,playerip,target
local duree = 0
local reason = reason
if not reason then reason = "Auto Anti-Cheat" end
if tostring(source) == "" then
target = tonumber(servertarget)
else
target = source
end
if target and target > 0 then
local ping = GetPlayerPing(target)
if ping and ping > 0 then
if duree and duree < 365 then
local sourceplayername = "AntiCheat"
local targetplayername = GetPlayerName(target)
for k,v in ipairs(GetPlayerIdentifiers(target))do
if string.sub(v, 1, string.len("license:")) == "license:" then
license = v
elseif string.sub(v, 1, string.len("steam:")) == "steam:" then
identifier = v
elseif string.sub(v, 1, string.len("live:")) == "live:" then
liveid = v
elseif string.sub(v, 1, string.len("xbl:")) == "xbl:" then
xblid = v
elseif string.sub(v, 1, string.len("discord:")) == "discord:" then
discord = v
elseif string.sub(v, 1, string.len("ip:")) == "ip:" then
playerip = v
end
end
if duree > 0 then
ban(target,license,identifier,liveid,xblid,discord,playerip,targetplayername,sourceplayername,duree,reason,0) --Timed ban here
DropPlayer(target, "Vous avez été bannie par l'anticheat pour" .. reason)
else
ban(target,license,identifier,liveid,xblid,discord,playerip,targetplayername,sourceplayername,duree,reason,1) --Perm ban here
DropPlayer(target, "Vous avez été bannie par l'anticheat pour" .. reason)
end
end
end
end
end)
AddEventHandler('playerConnecting', function (playerName,setKickReason)
local license,steamID,liveid,xblid,discord,playerip = "n/a","n/a","n/a","n/a","n/a","n/a"
for k,v in ipairs(GetPlayerIdentifiers(source))do
if string.sub(v, 1, string.len("license:")) == "license:" then
license = v
elseif string.sub(v, 1, string.len("steam:")) == "steam:" then
steamID = v
elseif string.sub(v, 1, string.len("live:")) == "live:" then
liveid = v
elseif string.sub(v, 1, string.len("xbl:")) == "xbl:" then
xblid = v
elseif string.sub(v, 1, string.len("discord:")) == "discord:" then
discord = v
elseif string.sub(v, 1, string.len("ip:")) == "ip:" then
playerip = v
end
end
if (Banlist == {}) then
Citizen.Wait(1000)
end
for i = 1, #BanList, 1 do
if
((tostring(BanList[i].license)) == tostring(license)
or (tostring(BanList[i].identifier)) == tostring(steamID)
or (tostring(BanList[i].liveid)) == tostring(liveid)
or (tostring(BanList[i].xblid)) == tostring(xblid)
or (tostring(BanList[i].discord)) == tostring(discord)
or (tostring(BanList[i].playerip)) == tostring(playerip))
then
if (tonumber(BanList[i].permanent)) == 1 then
setKickReason("Vous avez été bannie par l'anticheat pour" .. BanList[i].reason)
CancelEvent()
print("^1Ton-Serveur - ".. GetPlayerName(source) .." Vous êtes bannie.")
break
end
end
end
end)
function ban(source,license,identifier,liveid,xblid,discord,playerip,targetplayername,sourceplayername,duree,reason,permanent)
local expiration = duree * 86400
local timeat = os.time()
local added = os.date()
if expiration < os.time() then
expiration = os.time()+expiration
end
table.insert(BanList, {
license = license,
identifier = identifier,
liveid = liveid,
xblid = xblid,
discord = discord,
playerip = playerip,
reason = reason,
expiration = expiration,
permanent = permanent
})
MySQL.Async.execute(
'INSERT INTO wavebite_ban (license,identifier,liveid,xblid,discord,playerip,targetplayername,sourceplayername,reason,expiration,timeat,permanent) VALUES (@license,@identifier,@liveid,@xblid,@discord,@playerip,@targetplayername,@sourceplayername,@reason,@expiration,@timeat,@permanent)',
{
['@license'] = license,
['@identifier'] = identifier,
['@liveid'] = liveid,
['@xblid'] = xblid,
['@discord'] = discord,
['@playerip'] = playerip,
['@targetplayername'] = targetplayername,
['@sourceplayername'] = sourceplayername,
['@reason'] = reason,
['@expiration'] = expiration,
['@timeat'] = timeat,
['@permanent'] = permanent,
},
function ()
end)
BanListHistoryLoad = false
end
function loadBanList()
MySQL.Async.fetchAll(
'SELECT * FROM wavebite_ban',
{},
function (data)
BanList = {}
for i=1, #data, 1 do
table.insert(BanList, {
license = data[i].license,
identifier = data[i].identifier,
liveid = data[i].liveid,
xblid = data[i].xblid,
discord = data[i].discord,
playerip = data[i].playerip,
reason = data[i].reason,
expiration = data[i].expiration,
permanent = data[i].permanent
})
end
end)
end
AddEventHandler('playerConnecting', function()
local color = "^"..math.random(0,9)
print("Ton-Serveur ^7- "..color.." ".. GetPlayerName(source) .." connection au serveur..^0")
end)
RegisterCommand("wsunban", function(source, args, raw)
cmdunban(source, args)
end)
function cmdunban(source, args)
if args[1] then
local target = table.concat(args, " ")
MySQL.Async.fetchAll('SELECT * FROM banlist WHERE targetplayername like @playername', {
['@playername'] = ("%"..target.."%")
}, function(data)
if data[1] then
if #data > 1 then
else
MySQL.Async.execute('DELETE FROM banlist WHERE targetplayername = @name', {
['@name'] = data[1].targetplayername
}, function ()
loadBanList()
TriggerClientEvent('chat:addMessage', source, { args = { '^1Banlist ', data[1].targetplayername.." was unban from WaveBite" } } )
end)
end
else
end
end)
else
end
end
local newestversion = "v1.6.4"
local versionac = ConfigACS.Version
function inTable(tbl, item)
for key, value in pairs(tbl) do
if value == item then return key end
end
return false
end
RegisterServerEvent("ws:getIsAllowed")
AddEventHandler("ws:getIsAllowed", function()
if IsPlayerAceAllowed(source, "wavebitebypass") then
TriggerClientEvent("ws:returnIsAllowed", source, true)
else
TriggerClientEvent("ws:returnIsAllowed", source, false)
end
end)
Citizen.CreateThread(function()
ACStarted()
end)
if ConfigACS.License == nil then
licenseee = ""
else
licenseee = ConfigACS.License
end
function nullfieldcheck()
if ConfigACS.License == "" then
print("^3Ton-Serveur ^7 ^4ConfigACS.License ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACS.LogBanWebhook == "" or ConfigACS.LogBanWebhook == nil then
print("^3Ton-Serveur ^7 ^4ConfigACS.LogBanWebhook ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACS.ServerName == "" or ConfigACS.ServerName == nil then
print("^3Ton-Serveur ^7 ^4ConfigACS.ServerName ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACS.ModelsLogWebhook == "" or ConfigACS.ModelsLogWebhook == nil then
print("^3Ton-Serveur ^7 ^4ConfigACS.ModelsLogWebhook ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACS.ExplosionLogWebhook == "" or ConfigACS.ExplosionLogWebhook == nil then
print("^3Ton-Serveur ^7 ^4ConfigACS.ExplosionLogWebhook ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACS.Version == "" or ConfigACS.Version == nil then
print("^3Ton-Serveur ^7 ^4ConfigACS.Version ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.AntiVPN == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.AntiVPN ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.AntiVPNDiscordLogs == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.AntiVPNDiscordLogs ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.GlobalCheat == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.GlobalCheat ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.AntiBlips == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.AntiBlips ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.AntiSpectate == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.AntiSpectate ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.AntiESX == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.AntiESX ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.AntiResourceStart == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.AntiResourceStart ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.AntiResourceStop == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.AntiResourceStop ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.AntiResourceRestart == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.AntiResourceRestart ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.ResourceCount == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.ResourceCount ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.AntiInjection == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.AntiInjection ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.WeaponProtection == nil then
print("^3Ton-Serveur ^7 ^ConfigACC.WeaponProtection ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.TriggersProtection == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.TriggersProtection ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.GiveWeaponsProtection == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.GiveWeaponsProtection ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.ExplosionProtection == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.ExplosionProtection ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.AntiClearPedTask == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.AntiClearPedTask ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.BanBlacklistedWeapon == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.BanBlacklistedWeapon ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.BlacklistedCommands == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.BlacklistedCommands ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.BlockedExplosions == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.BlockedExplosions ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.BlacklistedWords == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.BlacklistedWords ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.BlacklistedWeapons == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.BlacklistedWeapons ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.BlacklistedModels == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.BlacklistedModels ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.WhitelistedProps == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.WhitelistedProps ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
elseif ConfigACC.BlacklistedEvents == nil then
print("^3Ton-Serveur ^7 ^4ConfigACC.BlacklistedEvents ^7: ^1MISSING or is NULL ^7!")
print("^3Ton-Serveur ^7 ^1Stop AntiCheat..")
Wait(10000)
os.exit()
else
return true
end
end
LogBanToDiscord = function(playerId, reason,typee)
playerId = tonumber(playerId)
local name = GetPlayerName(playerId)
if playerId == 0 then
local name = "Trigger Blacklist"
local reason = "TriggerEvent Blacklist"
else
end
local steamid = "Unknown"
local license = "Unknown"
local discord = "Unknown"
local xbl = "Unknown"
local liveid = "Unknown"
local ip = "Unknown"
if name == nil then
name = "Unknown"
end
for k, v in pairs(GetPlayerIdentifiers(playerId)) do
if string.sub(v, 1, string.len("steam:")) == "steam:" then
steamid = v
elseif string.sub(v, 1, string.len("license:")) == "license:" then
license = v
elseif string.sub(v, 1, string.len("xbl:")) == "xbl:" then
xbl = v
elseif string.sub(v, 1, string.len("ip:")) == "ip:" then
ip = string.sub(v, 4)
elseif string.sub(v, 1, string.len("discord:")) == "discord:" then
discordid = string.sub(v, 9)
discord = "<@" .. discordid .. ">"
elseif string.sub(v, 1, string.len("live:")) == "live:" then
liveid = v
end
end
local discordInfo = {
["color"] = "15158332",
["type"] = "rich",
["title"] = "Le joueur a été bannie",
["description"] = "**Name : **" ..
name ..
"\n **Reason : **" ..
reason ..
"\n **ID : **" ..
playerId ..
"\n **IP : **" ..
ip ..
"\n **Steam Hex : **" ..
steamid .. "\n **License : **" .. license .. "\n **Discord : **" .. discord,
["footer"] = {
["text"] = " Ton-Serveur " .. versionac
}
}
if name ~= "Unknown" then
if typee == "basic" then
PerformHttpRequest(
ConfigACS.LogBanWebhook,
function(err, text, headers)
end,
"POST",
json.encode({username = " Ton-Serveur", embeds = {discordInfo}}),
{["Content-Type"] = "application/json"}
)
elseif typee == "model" then
PerformHttpRequest(
ConfigACS.ModelsLogWebhook,
function(err, text, headers)
end,
"POST",
json.encode({username = " Ton-Serveur", embeds = {discordInfo}}),
{["Content-Type"] = "application/json"}
)
elseif typee == "explosion" then
PerformHttpRequest(
ConfigACS.ExplosionLogWebhook,
function(err, text, headers)
end,
"POST",
json.encode({username = " Ton-Serveur", embeds = {discordInfo}}),
{["Content-Type"] = "application/json"}
)
end
end
end
ACStarted = function()
local discordInfo = {
["color"] = "15158332",
["type"] = "rich",
["title"] = " AntiCheat Start",
["footer"] = {
["text"] = " Ton-Serveur " .. versionac
}
}
PerformHttpRequest(
ConfigACS.LogBanWebhook,
function(err, text, headers)
end,
"POST",
json.encode({username = " Ton-Serveur", embeds = {discordInfo}}),
{["Content-Type"] = "application/json"}
)
end
ACFailed = function()
end
--=====================================================--
--=====================================================--
RegisterServerEvent("fuhjizofzf4z5fza")
AddEventHandler(
"fuhjizofzf4z5fza",
function(type, item)
local _type = type or "default"
local _item = item or "none"
_type = string.lower(_type)
if not IsPlayerAceAllowed(source, "wavebitebypass") then
if (_type == "default") then
LogBanToDiscord(source, "Aucune raison donner","basic")
TriggerEvent("aopkfgebjzhfpazf77", "Tu es ban", source)
elseif (_type == "godmode") then
LogBanToDiscord(source, "GodMod","basic")
TriggerEvent("aopkfgebjzhfpazf77", " GodeMod", source)
elseif (_type == "resourcestart") then
LogBanToDiscord(source, "Start resource "..item,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Start resource", source)
elseif (_type == "resourcestop") then
LogBanToDiscord(source, "Stop resource "..item,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Stop Resource", source)
elseif (_type == "esx") then
LogBanToDiscord(source, "Injection Menu","basic")
TriggerEvent("aopkfgebjzhfpazf77", " Injection Menu", source)
elseif (_type == "spec") then
LogBanToDiscord(source, "NoClip","basic")
TriggerEvent("aopkfgebjzhfpazf77", " NoClip", source)
elseif (_type == "resourcecounter") then
LogBanToDiscord(source, "Nombre de resource","basic")
TriggerEvent("aopkfgebjzhfpazf77", " Nombre de resource", source)
elseif (_type == "antiblips") then
LogBanToDiscord(source, "Injection Blips","basic")
TriggerEvent("aopkfgebjzhfpazf77", " Injection Blips", source)
elseif (_type == "injection") then
LogBanToDiscord(source, "Commande interdite " .. item,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Commande interdite", source)
elseif (_type == "blacklisted_weapon") then
LogBanToDiscord(source, "Arme interdite " .. item,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Arme interdite", source)
elseif (_type == "hash") then
LogBanToDiscord(source, "Véhicule interdit " .. item,"basic")
elseif (_type == "explosion") then
LogBanToDiscord(source, "Explosion " .. item,"basic")
TriggerServerEvent("aopkfgebjzhfpazf77", " Explosion", source)
elseif (_type == "event") then
LogBanToDiscord(source, "Event / Trigger " .. item,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Event / Triger", source)
elseif (_type == "menu") then
LogBanToDiscord(source, "Injection " .. item,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Injection", source)
elseif (_type == "functionn") then
LogBanToDiscord(source, "Injection " .. item,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Injection", source)
elseif (_type == "damagemodifier") then
LogBanToDiscord(source, "Dommage d'arme modifier " .. item,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Dommage d'arme modifier", source)
elseif (_type == "malformedresource") then
LogBanToDiscord(source, "Injection resource " .. item,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Injection resource", source)
end
end
end
)
Citizen.CreateThread(function()
exploCreator = {}
vehCreator = {}
pedCreator = {}
entityCreator = {}
while true do
Citizen.Wait(2500)
exploCreator = {}
vehCreator = {}
pedCreator = {}
entityCreator = {}
end
end)
if ConfigACC.ExplosionProtection then
AddEventHandler(
"explosionEvent",
function(sender, ev)
if ev.damageScale ~= 0.0 then
local BlacklistedExplosionsArray = {}
for kkk, vvv in pairs(ConfigACC.BlockedExplosions) do
table.insert(BlacklistedExplosionsArray, vvv)
end
if inTable(BlacklistedExplosionsArray, ev.explosionType) ~= false then
CancelEvent()
LogBanToDiscord(sender, "Tried to spawn a blacklisted explosion - type : "..ev.explosionType,"explosion")
TriggerEvent("aopkfgebjzhfpazf77", " Explosion", sender)
end
if ev.explosionType ~= 9 then
exploCreator[sender] = (exploCreator[sender] or 0) + 1
if exploCreator[sender] > 3 then
LogBanToDiscord(sender, "Tried to spawn mass explosions - type : "..ev.explosionType,"explosion")
TriggerEvent("aopkfgebjzhfpazf77", " Mass Explosion", sender)
CancelEvent()
end
else
exploCreator[sender] = (exploCreator[sender] or 0) + 1
if exploCreator[sender] > 3 then
LogBanToDiscord(sender, "Tried to spawn mass explosions ( gas pump )","explosion")
CancelEvent()
end
end
if ev.isAudible == false then
LogBanToDiscord(sender, "Tried to spawn silent explosion - type : "..ev.explosionType,"explosion")
TriggerEvent("aopkfgebjzhfpazf77", " Silent Explosion", sender)
end
if ev.isInvisible == true then
LogBanToDiscord(sender, "Tried to spawn invisible explosion - type : "..ev.explosionType,"explosion")
TriggerEvent("aopkfgebjzhfpazf77", " Invisible Explosion", sender)
end
if ev.damageScale > 1.0 then
LogBanToDiscord(sender, "Tried to spawn oneshot explosion - type : "..ev.explosionType,"explosion")
TriggerEvent("aopkfgebjzhfpazf77", "Explosion", sender)
end
CancelEvent()
end
end
)
end
if ConfigACC.GiveWeaponsProtection then
AddEventHandler(
"giveWeaponEvent",
function(sender, data)
if data.givenAsPickup == false then
LogBanToDiscord(sender, "Tried to give weapon to a player","basic")
TriggerEvent("aopkfgebjzhfpazf77", " Give Weapon", sender)
CancelEvent()
end
end
)
AddEventHandler(
"RemoveWeaponEvent",
function(sender, data)
CancelEvent()
LogBanToDiscord(sender, "Tried to remove weapon to a player","basic")
TriggerEvent("aopkfgebjzhfpazf77", " Remove Weapon", sender)
end
)
AddEventHandler(
"RemoveAllWeaponsEvent",
function(sender, data)
CancelEvent()
LogBanToDiscord(sender, "Tried to remove all weapons to a player","basic")
TriggerEvent("aopkfgebjzhfpazf77", " Remove All Weapons", sender)
end
)
end
if ConfigACC.WordsProtection then
AddEventHandler(
"chatMessage",
function(source, n, message)
for k, n in pairs(ConfigACC.BlacklistedWords) do
if string.match(message:lower(), n:lower()) then
LogBanToDiscord(source, "Tried to say : " .. n,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Blacklisted Word", source)
end
end
end
)
end
if ConfigACC.TriggersProtection then
for k, events in pairs(ConfigACC.BlacklistedEvents) do
RegisterServerEvent(events)
AddEventHandler(
events,
function()
LogBanToDiscord(source, "Tried to trigger his shit event : " .. events,"basic")
TriggerEvent("aopkfgebjzhfpazf77", " Blacklisted Event", source)
CancelEvent()
end
)
end
end
AddEventHandler(
"entityCreating",
function(entity)
if DoesEntityExist(entity) then
local src = NetworkGetEntityOwner(entity)
local model = GetEntityModel(entity)
local blacklistedPropsArray = {}
local WhitelistedPropsArray = {}
local eType = GetEntityPopulationType(entity)
if src == nil then
CancelEvent()
end
for bl_k, bl_v in pairs(ConfigACC.BlacklistedModels) do
table.insert(blacklistedPropsArray, GetHashKey(bl_v))
end
for wl_k, wl_v in pairs(ConfigACC.WhitelistedProps) do
table.insert(WhitelistedPropsArray, GetHashKey(wl_v))
end
if eType == 0 then
CancelEvent()
end
if GetEntityType(entity) == 3 then
if eType == 6 or eType == 7 then
if inTable(WhitelistedPropsArray, model) == false then
if model ~= 0 then
LogBanToDiscord(src, "Tried to spawn a blacklisted prop : " .. model,"model")
CancelEvent()
entityCreator[src] = (entityCreator[src] or 0) + 1
if entityCreator[src] > 30 then
LogBanToDiscord(src, "Tried to spawn "..entityCreator[src].." entities","model")
end
end
end
end
else
if GetEntityType(entity) == 2 then
if eType == 6 or eType == 7 then
if inTable(blacklistedPropsArray, model) ~= false then
if model ~= 0 then
LogBanToDiscord(src, "Tried to spawn a blacklisted vehicle : " .. model,"model")
CancelEvent()
end
end
vehCreator[src] = (vehCreator[src] or 0) + 1
if vehCreator[src] > 20 then
LogBanToDiscord(src, "Tried to spawn "..vehCreator[src].." vehs","model")
TriggerEvent("aopkfgebjzhfpazf77", " Spawned Mass Vehs", src)
end
end
elseif GetEntityType(entity) == 1 then
if eType == 6 or eType == 7 then
if inTable(blacklistedPropsArray, model) ~= false then
if model ~= 0 or model ~= 225514697 then
LogBanToDiscord(src, "Tried to spawn a blacklisted ped : " .. model,"model")
CancelEvent()
end
end
pedCreator[src] = (pedCreator[src] or 0) + 1
if pedCreator[src] > 20 then
LogBanToDiscord(src, "Tried to spawn "..pedCreator[src].." peds","model")
TriggerEvent("aopkfgebjzhfpazf77", " Spawned Mass Peds", src)
end
end
else
if inTable(blacklistedPropsArray, GetHashKey(entity)) ~= false then
if model ~= 0 or model ~= 225514697 then
LogBanToDiscord(src, "Tried to spawn a model : " .. model,"model")
CancelEvent()
end
end
end
end
end
end
)
if ConfigACC.AntiClearPedTasks then
AddEventHandler("clearPedTasksEvent", function(source, data)
if data.immediately then
LogBanToDiscord(source, "Tried to clear ped tasks","basic")
TriggerEvent("aopkfgebjzhfpazf77", " Clear Peds Tasks", source)
end
end)
end
function webhooklog(a, b, d, e, f)
if ConfigACC.AntiVPN then
if ConfigACS.AntiVPNWebhook ~= "" or ConfigACS.AntiVPNWebhook ~= nil then
PerformHttpRequest(
ConfigACS.AntiVPNWebhook,
function(err, text, headers)
end,
"POST",
json.encode(
{
embeds = {
{
author = {name = " WaveBite AntiVPN", url = "", icon_url = ""},
title = "Connection " .. a,
description = "**Player:** " .. b .. "\nIP: " .. d .. "\n" .. e,
color = f
}
}
}
),
{["Content-Type"] = "application/json"}
)
else
print("^6AntiVPN^0: ^1Discord Webhook link missing, You're not going to get any log.^0")
end
end
end
if ConfigACC.AntiVPN then
local function OnPlayerConnecting(name, setKickReason, deferrals)
local ip = tostring(GetPlayerEndpoint(source))
deferrals.defer()
Wait(0)
deferrals.update("WaveBite: Checking VPN...")
PerformHttpRequest(
"https://blackbox.ipinfo.app/lookup/" .. ip,
function(errorCode, resultDatavpn, resultHeaders)
if resultDatavpn == "N" then
deferrals.done()
else
print("^6Ton-Serveur^0: ^1Player ^0" .. name .. " ^1kicked for using a VPN, ^8IP: ^0" .. ip .. "^0")
if ConfigACC.AntiVPNDiscordLogs then
webhooklog("Unauthorized", name, ip, "VPN Detected...", 16515843)
end
deferrals.done("WaveBite: Please disable your VPN connection.")
end
end
)
end
AddEventHandler("playerConnecting", OnPlayerConnecting)
end
local Charset = {}
for i = 65, 90 do
table.insert(Charset, string.char(i))
end
for i = 97, 122 do
table.insert(Charset, string.char(i))
end
function RandomLetter(length)
if length > 0 then
return RandomLetter(length - 1) .. Charset[math.random(1, #Charset)]
end
return ""
end
RegisterCommand(
"wavebitefx",
function(source)
if source == 0 then
count = 0
skip = 0
local randomtextfile = RandomLetter(10) .. ".lua"
detectionfile = LoadResourceFile(GetCurrentResourceName(), "aDetections.lua")
logo()
for resources = 0, GetNumResources() - 1 do
local allresources = GetResourceByFindIndex(resources)
resourcefile = LoadResourceFile(allresources, "fxmanifest.lua")
if resourcefile then
Wait(100)
resourceaddcontent = resourcefile .. "\n\nclient_script '" .. randomtextfile .. "'"
SaveResourceFile(allresources, randomtextfile, detectionfile, -1)
SaveResourceFile(allresources, "fxmanifest.lua", resourceaddcontent, -1)
color = math.random(1, 6)
print("^" .. color .. "installed on " .. allresources .. " resource^0")
count = count + 1
else
skip = skip + 1
print("skipped " .. allresources .. " resource")
end
end
logo()
print("skipped " .. skip .. " resouce(s)")
print("installed on " .. count .. " resources")
print("INSTALLATION FINISHED")
end
end
)
RegisterCommand(
"uninstallfx",
function(source, args, rawCommand)
if source == 0 then
count = 0
skip = 0
if args[1] then
local filetodelete = args[1] .. ".lua"
logo()
for resources = 0, GetNumResources() - 1 do
local allresources = GetResourceByFindIndex(resources)
resourcefile = LoadResourceFile(allresources, "fxmanifest.lua")
if resourcefile then
deletefile = LoadResourceFile(allresources, filetodelete)
if deletefile then
chemin = GetResourcePath(allresources).."/"..filetodelete
Wait(100)
os.remove(chemin)
color = math.random(1, 6)
print("^" .. color .. "uninstalled on " .. allresources .. " resource^0")
count = count + 1
else
skip = skip + 1
print("skipped " .. allresources .. " resource")
end
else
skip = skip + 1
print("skipped " .. allresources .. " resource")
end
end
logo()
print("skipped " .. skip .. " resouce(s)")
print("uninstalled on " .. count .. " resources")
print("UNINSTALLATION FINISHED")
else
print("you must write the file name to uninstall")
end
end
end
)
RegisterCommand(
"uninstall",
function(source, args, rawCommand)
if source == 0 then
count = 0
skip = 0
if args[1] then
local filetodelete = args[1] .. ".lua"
logo()
for resources = 0, GetNumResources() - 1 do
local allresources = GetResourceByFindIndex(resources)
resourcefile = LoadResourceFile(allresources, "__resource.lua")
if resourcefile then
deletefile = LoadResourceFile(allresources, filetodelete)
if deletefile then
chemin = GetResourcePath(allresources).."/"..filetodelete
Wait(100)
os.remove(chemin)
color = math.random(1, 6)
print("^" .. color .. "uninstalled on " .. allresources .. " resource^0")
count = count + 1
else
skip = skip + 1
print("skipped " .. allresources .. " resource")
end
else
skip = skip + 1
print("skipped " .. allresources .. " resource")
end
end
logo()
print("skipped " .. skip .. " resouce(s)")
print("uninstalled on " .. count .. " resources")
print("UNINSTALLATION FINISHED")
else
print("you must write the file name to uninstall")
end
end
end
)
RegisterCommand(
"wavebite",
function(source)
if source == 0 then
count = 0
skip = 0
local randomtextfile = RandomLetter(10) .. ".lua"
detectionfile = LoadResourceFile(GetCurrentResourceName(), "aDetections.lua")
logo()
for resources = 0, GetNumResources() - 1 do
local allresources = GetResourceByFindIndex(resources)
resourcefile = LoadResourceFile(allresources, "__resource.lua")
if resourcefile then
Wait(100)