-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsourceC.lua
289 lines (260 loc) · 11.2 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
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
-- Developed by Xoop Team
-- 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
addDebugHook("preFunction", function(sourceResource)
if sourceResource == getThisResource() then return end
return "skip"
end,{"addDebugHook"})
addEventHandler("onClientResourceStop", resourceRoot, function(arg)
if string.lower(getResourceName(arg)) == string.lower(getThisResource().name) then
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #FFFFFFStop Resource [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
if STOP_RESOURCE_BAN_KICK then
triggerServerEvent("XoopAC:Ban", localPlayer)
else
triggerServerEvent("XoopAC:Kick", localPlayer)
end
end
end)
-- Save Injected Code
function SaveCode(code)
if SAVE_INJECTED_CODE then
triggerServerEvent("XoopAC-SaveCode",localPlayer, code, getXoopPassword())
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,getXoopPassword())
end,7000,0)
end
function clientCheatScan()
if isWorldSpecialPropertyEnabled("aircars") then
clientCheat()
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #ffffffAIRCARS [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
triggerServerEvent("XoopAC:Ban", localPlayer)
end
if isWorldSpecialPropertyEnabled("hovercars") then
clientCheat()
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #ffffffHOVERCARS [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
triggerServerEvent("XoopAC:Ban", localPlayer)
end
if isWorldSpecialPropertyEnabled("extrabunny") then
clientCheat()
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #ffffffEXTRA BUNNY [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
triggerServerEvent("XoopAC:Ban", localPlayer)
end
if isWorldSpecialPropertyEnabled("extrajump") then
clientCheat()
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #ffffffEXTRA JUMP [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
triggerServerEvent("XoopAC:Ban", localPlayer)
end
if getGameSpeed() > 1 then
clientCheat()
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #ffffffGAMESPEED CHEAT [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
triggerServerEvent("XoopAC:Ban", localPlayer)
end
if ( doesPedHaveJetPack (localPlayer) and DISABLE_JETPACK == true ) then
clientCheat()
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #ffffffJETPACK CHEAT [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
end
if getLocalPlayer().vehicle then
if (Vector3(getElementVelocity(getLocalPlayer().vehicle)) * 180).length > 500 then
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #ffffffCAR SPEED MORE THEN 500 [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
end
else
if getPedMoveState(localPlayer) ~= "fall" and (Vector3(getElementVelocity(localPlayer)) * 50).length > 20 then
triggerServerEvent("XoopAc:outputForAll", localPlayer, Xoop.." #ffffffSPEED CHEAT [ " ..getPlayerName(localPlayer).. " ]", getXoopPassword())
triggerServerEvent("XoopAC:Ban", 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)
if (DISABLE_JETPACK) then
triggerServerEvent("XoopAC:TakeJetPack", localPlayer)
end
for propertyName, propertyState in pairs(worldSpecialProperties) do
setWorldSpecialPropertyEnabled(propertyName, propertyState)
end
end
function CheckLuaFile(FileName)
if type(FileName:find(".lua")) == "nil" and FileName ~= "[string \"...\"]" and FileName ~= "[string \"?\"]" then
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #FFFFFFLua Execute [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
triggerServerEvent("XoopAC:Ban", localPlayer)
return true
end
return false
end
DebugHook = addDebugHook("preFunction", function(_,_, _, arg, _, ...)
if CheckLuaFile(arg) then
return "skip"
end
end,{"addDebugHook","removeDebugHook","triggerServerEvent"})
if not DebugHook then
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #FFFFFFDebugHook Skip [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
triggerServerEvent("XoopAC:Kick", localPlayer)
end
local blockedFunctions = {
'outputChatBox',
'getAllElementData',
'function',
'triggerEvent',
'triggerClientEvent',
'triggerServerEvent',
'setElementData',
'addEvent',
'addEventHandler',
'addDebugHook',
'createExplosion',
'createProjectile',
'setElementPosition',
'createVehicle',
'setElementHealth',
'setPedArmor',
}
addDebugHook( "preFunction", function( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... )
if CheckLuaFile(luaFilename) then return end
SaveCode( ({...})[1] )
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #FFFFFFLua Execute [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
triggerServerEvent("XoopAC:WbHk", localPlayer, getXoopPassword())
if (CODE_INJECTOR_BAN ~= false) then
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #FFFFFFThe player: "..getPlayerName(localPlayer).." banned.", getXoopPassword())
triggerServerEvent("XoopAC:Ban", localPlayer)
end
return "skip"
end, {"loadstring", "pcall", "load"} )
local SPEED_LAST_X ,SPEED_LAST_Y ,SPEED_LAST_Z = 0 , 0, 0
local lastTime , check = 0, 0;
setTimer(function() check = 0 end, 800, 0)
function detectAirBrake()
if (not isPedOnGround(localPlayer) and not getPedContactElement(localPlayer)) and (getPedMoveState(localPlayer) == 'fall') then return end
if (Vector3(getElementPosition(getLocalPlayer())).z < 2000) then
if not (getTickCount() - lastTime == 0) then
local fSpeedRatio = getDistanceBetweenPoints3D(SPEED_LAST_X,SPEED_LAST_Y,SPEED_LAST_Z,Vector3(getElementPosition(getLocalPlayer())).x,Vector3(getElementPosition(getLocalPlayer())).y,Vector3(getElementPosition(getLocalPlayer())).z);
if fSpeedRatio < 0 then
fSpeedRatio = - fSpeedRatio;
end
if (fSpeedRatio > 1.35 and fSpeedRatio < 8) then
check = check + 1
if check >= 15 or (check >= 10 and getElementCollisionsEnabled(localPlayer) == false) then
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #ffffffNOCLIP [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
check = 0
end
end
SPEED_LAST_X, SPEED_LAST_Y, SPEED_LAST_Z = fPx , fPy , fPz
lastTime = getTickCount();
end
end
end
addEventHandler("onClientPreRender", root, detectAirBrake)
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", getXoopPassword())
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,Xoop.." #FFFFFFLUA INJECT [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
triggerServerEvent("XoopAC:WbHk", localPlayer, getXoopPassword())
if (CODE_INJECTOR_BAN ~= false) then
triggerServerEvent("XoopAC:Ban", localPlayer)
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #FFFFFFThe player: "..getPlayerName(localPlayer).." banned.", getXoopPassword())
end
cancelEvent()
end
end)
function cancel( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... )
return "skip"
end
addDebugHook( "preFunction", cancel,{"setPedOnFire","createProjectile","blowVehicle"})
function getBonePosition( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... )
if DISABLE_GET_BONEPOSITION == false then return end
return "skip"
end
addDebugHook( "preFunction", getBonePosition,{"getPedBonePosition"})
addEventHandler ( "onClientVehicleExplode", getRootElement(), cancelEvent )
-- Godmode
local PlayerHealth = getElementHealth(localPlayer)
addEventHandler("onClientPlayerDamage", localPlayer, function (attacker, weapon, bodypart)
setTimer(function()
local NewPlayerHealth = getElementHealth(localPlayer)
if (NewPlayerHealth == PlayerHealth) and NewPlayerHealth > 0 then
triggerServerEvent("XoopAc:outputForAll", localPlayer, Xoop.." #FFFFFFGODMODE [ "..getPlayerName(localPlayer).." ]", getXoopPassword())
end
PlayerHealth = NewPlayerHealth
end,10,1)
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,Xoop.." #FFFFFFThe player: "..getPlayerName(localPlayer).." is using the aim_bot cheat.", getXoopPassword())
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:Ban", localPlayer)
triggerServerEvent("XoopAc:outputForAll", localPlayer,Xoop.." #FFFFFFPaste Lua Code [ ".. getPlayerName(localPlayer) .." ]", getXoopPassword())
end
end
end)