-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsourceC.lua
244 lines (225 loc) · 8.58 KB
/
sourceC.lua
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
-- Developed by Xoop Team and Mohammad @story_fe
local Xoop ="#a8269d[#9f249aX#932196o#851d92o#76198ep#671589-#591185A#4d0e81C#440c7e]"
for m, v in pairs(_G) do
if not m then
triggerServerEvent("XoopAC:Kick", localPlayer)
end
end
-- Trigger Event Counter
local tCount = 0
setTimer(function()
tCount = 0
end, 3000, 0)
--
function onPreFunction( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... )
if functionName == "addDebugHook" and sourceResource ~= getThisResource() then return "skip" end
if functionName == "loadstring" or functionName == "load" or functionName == "pcall" then
saveCode( ({...})[1] )
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Used Lua Executor And Kicked", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
return "skip"
end
if functionName == "setPedOnFire" or functionName == "createProjectile" or functionName == "createExplosion" or functionName == "blowVehicle" then
return "skip"
end
if functionName == "triggerServerEvent" or functionName == "triggerEvent" then
tCount = tCount + 1
if tCount >= 20 then
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Kicked Because Of Spamming", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
end
end
Debug = addDebugHook("preFunction", onPreFunction)
-- Saving Injected Code
function saveCode(code)
if SAVE_INJECTED_CODE then
triggerServerEvent("XoopAC-SaveCode",localPlayer, code, getXoopPasswordClient())
end
end
addEventHandler("onClientResourceStop", resourceRoot, function(arg)
if string.lower(getResourceName(arg)) == string.lower(getThisResource().name) then
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Kicked By Anticheat", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
end)
-- Gun Hack
if Check_Gun_Hack then
setTimer(function()
local Ary = {}
for i=1,12 do
Ary[i] = getPedWeapon(localPlayer,i)
end
triggerServerEvent("XoopAC-onPlayerGunCheck",localPlayer,Ary,getXoopPasswordClient())
end,7000,0)
end
function clientCheatScan()
if isWorldSpecialPropertyEnabled("aircars") then
clientCheat()
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Used Aircars And Kicked", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
if isWorldSpecialPropertyEnabled("hovercars") then
clientCheat()
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Used Hovercars And Kicked", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
if isWorldSpecialPropertyEnabled("extrabunny") then
clientCheat()
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Used Extra Bunny And Kicked", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
if isWorldSpecialPropertyEnabled("extrajump") then
clientCheat()
triggerServerEvent("XoopAC:outputForAll", localPlayer,Xoop.." #ffffffEXTRA JUMP [ "..getPlayerName(localPlayer).." ]", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
if getGameSpeed() > 1 then
clientCheat()
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Used Speed Cheat And Kicked", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
if getLocalPlayer().vehicle then
if (Vector3(getElementVelocity(getLocalPlayer().vehicle)) * 180).length > 500 then
triggerServerEvent("XoopAC:outputForAll", localPlayer,Xoop.." #ffffff"..getPlayerName(localPlayer).."'s Car Speed Is Suspicious'", getXoopPasswordClient())
end
else
if getPedMoveState(localPlayer) ~= "fall" and (Vector3(getElementVelocity(localPlayer)) * 50).length > 20 then
triggerServerEvent("XoopAC:outputForAll", localPlayer, Xoop.." #ffffffSPEED CHEAT [ " ..getPlayerName(localPlayer).. " ]", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
end
end
setTimer(clientCheatScan, 1000, 0)
function clientCheat()
local worldSpecialProperties = {
["hovercars"] = false,
["aircars"] = false,
["extrabunny"] = false,
["extrajump"] = false,
["randomfoliage"] = true,
["snipermoon"] = false,
["extraairresistance"] = true,
["underworldwarp"] = true,
["vehiclesunglare"] = false,
["coronaztest"] = true,
["watercreatures"] = true,
["burnflippedcars"] = true,
["fireballdestruct"] = true,
}
setGameSpeed(1)
for propertyName, propertyState in pairs(worldSpecialProperties) do
setWorldSpecialPropertyEnabled(propertyName, propertyState)
end
end
if not Debug then
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Kicked By Anticheat", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
local blockedFunctions = {
'outputChatBox',
'getAllElementData',
'function',
'triggerEvent',
'triggerClientEvent',
'triggerServerEvent',
'setElementData',
'addEvent',
'addEventHandler',
'addDebugHook',
'createExplosion',
'createProjectile',
'setElementPosition',
'createVehicle',
'setElementHealth',
'setPedArmor',
}
function isElementInAir(element)
return not (isPedOnGround(element) or getPedContactElement(element))
end
local noclip_ac = {
x = localPlayer.position.x,
y = localPlayer.position.y,
z = localPlayer.position.z,
c = 0,
distanceLimit = 0.5,
}
addEventHandler("onClientRender",root,function()
if not (getPedOccupiedVehicle(localPlayer)) and isElementInAir(localPlayer) then
local x,y,z = getElementPosition(localPlayer)
if math.abs(x-noclip_ac.x) > noclip_ac.distanceLimit or math.abs(y-noclip_ac.y) > noclip_ac.distanceLimit then
noclip_ac.c = noclip_ac.c + 1
end
noclip_ac.x = x
noclip_ac.y = y
noclip_ac.z = z
end
end)
setTimer(function()
if noclip_ac.c > 10 then
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Used FlyHack And Kicked", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
noclip_ac.c = 0
end,1000,0)
function projectileCreation( creator )
if getElementType(creator) == "player" then
local projectileType = getProjectileType( source )
local x, y, z = getElementPosition ( source )
setElementPosition(source, x,y,z-5000)
destroyElement(source)
triggerServerEvent("XoopAC:outputForAll", creator, Xoop.." #ffffff"..getPlayerName(creator).." Created A Projectile", getXoopPasswordClient())
end
end
addEventHandler( "onClientProjectileCreation", root, projectileCreation )
addEventHandler("onClientGUIChanged", root, function(element)
local text = guiGetText(element)
local injecting = false
for _, v in ipairs(blockedFunctions) do
if (string.find(text,v)) then
injecting = true
end
end
if (injecting == true ) then
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Executed A Cheat Code And Kicked", getXoopPasswordClient())
triggerServerEvent("XoopAC:Kick", localPlayer)
cancelEvent()
end
end)
--[[
Anti aimbot was added from here:
https://github.com/ruip005/mta_anticheat/blob/source/v2.3.0.03/cMain.lua
]]
Cache = {}
function AntiAimBot(attacker, weapon, bodypart, loss)
if attacker == getLocalPlayer() then
if bodypart == 9 then
for _, v in ipairs(ADMIN_LEVEL_DATANAMES) do
local adminlevel = getElementData(localPlayer, v) or 0
if (adminlevel > 0) or (isPedInVehicle(localPlayer) == true) then return end
end
if not Cache.Numbers then
Cache.Numbers = 0
end
if Cache then
Cache.Numbers = Cache.Numbers + 1
setTimer(function()
Cache.Numbers = 0
end, 3000, 1)
if Cache.Numbers == 5 then
triggerServerEvent("XoopAC:outputForAll", localPlayer,"Is Using An AimBot", getXoopPasswordClient())
end
end
end
end
end
addEventHandler('onClientPedDamage', getRootElement(), AntiAimBot)
addEventHandler('onClientPlayerDamage', getRootElement(), AntiAimBot)
addEventHandler("onClientPaste", root, function(text)
for index , blockedFunction in ipairs(blockedFunctions) do
if text:find(blockedFunction) then
triggerServerEvent("XoopAC:Kick", localPlayer)
triggerServerEvent("XoopAC:outputForAll", localPlayer,Xoop.." #FFFFFF".. getPlayerName(localPlayer) .." Pasted A Lua Code And Kicked", getXoopPasswordClient())
end
end
end)