-
Notifications
You must be signed in to change notification settings - Fork 42
/
ac_c.lua
232 lines (201 loc) · 7.18 KB
/
ac_c.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
Citizen.CreateThread(function()
while true do
Citizen.Wait(30000)
TriggerServerEvent("anticheese:timer")
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(60000)
local curPed = PlayerPedId()
local curHealth = GetEntityHealth( curPed )
SetEntityHealth( curPed, curHealth-2)
local curWait = math.random(10,150)
-- this will substract 2hp from the current player, wait 50ms and then add it back, this is to check for hacks that force HP at 200
Citizen.Wait(curWait)
if not IsPlayerDead(PlayerId()) then
if PlayerPedId() == curPed and GetEntityHealth(curPed) == curHealth and GetEntityHealth(curPed) ~= 0 then
TriggerServerEvent("AntiCheese:HealthFlag", false, curHealth-2, GetEntityHealth( curPed ),curWait )
elseif GetEntityHealth(curPed) == curHealth-2 then
SetEntityHealth(curPed, GetEntityHealth(curPed)+2)
end
end
if GetEntityHealth(curPed) > 400 then
TriggerServerEvent("AntiCheese:HealthFlag", false, GetEntityHealth( curPed )-200, GetEntityHealth( curPed ),curWait )
end
if GetPlayerInvincible( PlayerId() ) then -- if the player is invincible, flag him as a cheater and then disable their invincibility
TriggerServerEvent("AntiCheese:HealthFlag", true, curHealth-2, GetEntityHealth( curPed ),curWait )
SetPlayerInvincible( PlayerId(), false )
end
end
end)
-- prevent infinite ammo, godmode, invisibility and ped speed hacks
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
SetPedInfiniteAmmoClip(PlayerPedId(), false)
SetEntityInvincible(PlayerPedId(), false)
SetEntityCanBeDamaged(PlayerPedId(), true)
ResetEntityAlpha(PlayerPedId())
local fallin = IsPedFalling(PlayerPedId())
local ragg = IsPedRagdoll(PlayerPedId())
local parac = GetPedParachuteState(PlayerPedId())
if parac >= 0 or ragg or fallin then
SetEntityMaxSpeed(PlayerPedId(), 80.0)
else
SetEntityMaxSpeed(PlayerPedId(), 7.1)
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(60000)
if NetworkIsInSpectatorMode() then
TriggerServerEvent("AntiCheese:Spectate")
end
if GetPlayerWeaponDamageModifier(PlayerId()) > 1.0 then
TriggerServerEvent("AntiCheese:Damage")
end
if GetUsingseethrough() then
TriggerServerEvent("AntiCheese:Thermal")
end
if GetUsingnightvision() then
TriggerServerEvent("AntiCheese:Night")
end
local playerPed = PlayerPedId()
if IsPedSittingInAnyVehicle(playerPed) and IsVehicleVisible(GetVehiclePedIsIn(playerPed, false)) then
TriggerServerEvent("AntiCheese:CarVisible")
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(30000)
local DetectableTextures = {
{txd = "HydroMenu", txt = "HydroMenuHeader", name = "HydroMenu"},
{txd = "John", txt = "John2", name = "SugarMenu"},
{txd = "darkside", txt = "logo", name = "Darkside"},
{txd = "ISMMENU", txt = "ISMMENUHeader", name = "ISMMENU"},
{txd = "dopatest", txt = "duiTex", name = "Copypaste Menu"},
{txd = "fm", txt = "menu_bg", name = "Fallout"},
{txd = "wave", txt = "logo", name ="Wave"},
{txd = "wave1", txt = "logo1", name = "Wave (alt.)"},
{txd = "meow2", txt = "woof2", name ="Alokas66", x = 1000, y = 1000},
{txd = "adb831a7fdd83d_Guest_d1e2a309ce7591dff86", txt = "adb831a7fdd83d_Guest_d1e2a309ce7591dff8Header6", name ="Guest Menu"},
{txd = "hugev_gif_DSGUHSDGISDG", txt = "duiTex_DSIOGJSDG", name="HugeV Menu"},
{txd = "MM", txt = "menu_bg", name="MetrixFallout"},
{txd = "wm", txt = "wm2", name="WM Menu"},
{txd = "absoluteeulen", txt="Absolut", name="Absolut Menu"},
{txd = "Dopamine", txt="Dopameme", name="Dopamine Menu"},
{txd = "SkidMenu", txt="skidmenu", name="Skid Menu"},
{txd = "tiago", txt="Tiago", name="Tiago Menu"},
{txd = "lynxmenu", txt="lynxmenu", name="Lynx Menu"},
{txd = "Reaper", txt="reaper", name="Reaper Menu"}
}
for i, data in pairs(DetectableTextures) do
if data.x and data.y then
if GetTextureResolution(data.txd, data.txt).x == data.x and GetTextureResolution(data.txd, data.txt).y == data.y then
TriggerServerEvent("AntiCheese:DuiFlag", "Cheating", "Mod Menu Detected ("..data.name.." Detected via DUI Check)", true)
end
else
if GetTextureResolution(data.txd, data.txt).x ~= 4.0 then
TriggerServerEvent("AntiCheese:DuiFlag", "Cheating", "Mod Menu Detected ("..data.name.." Detected via DUI Check)", true)
end
end
end
end
end)
RegisterNetEvent("AntiCheese:RemoveInventoryWeapons")
AddEventHandler('AntiCheese:RemoveInventoryWeapons', function()
RemoveAllPedWeapons(PlayerPedId(),false)
end)
function ReqAndDelete(object, detach)
if DoesEntityExist(object) then
NetworkRequestControlOfEntity(object)
while not NetworkHasControlOfEntity(object) do
Citizen.Wait(1)
end
if detach then
DetachEntity(object, 0, false)
end
SetEntityCollision(object, false, false)
SetEntityAlpha(object, 0.0, true)
SetEntityAsMissionEntity(object, true, true)
SetEntityAsNoLongerNeeded(object)
DeleteEntity(object)
end
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(500)
local ped = PlayerPedId()
local handle, object = FindFirstObject()
local finished = false
repeat
Citizen.Wait(1)
if IsEntityAttached(object) and DoesEntityExist(object) then
if GetEntityModel(object) == `prop_acc_guitar_01` then
ReqAndDelete(object, true)
end
end
finished, object = FindNextObject(handle)
until not finished
EndFindObject(handle)
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsPedJumping(PlayerPedId()) then
local jumplength = 0
repeat
Citizen.Wait(0)
jumplength=jumplength+1
local isStillJumping = IsPedJumping(PlayerPedId())
until not isStillJumping
if jumplength > 250 then
TriggerServerEvent("AntiCheese:JumpFlag", jumplength )
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(500)
local playerPed = PlayerPedId()
for _,theWeapon in ipairs(BlacklistedWeapons) do
Citizen.Wait(1)
if HasPedGotWeapon(playerPed,theWeapon,false) == 1 then
TriggerServerEvent("AntiCheese:WeaponFlag", theWeapon)
RemoveWeaponFromPed(playerPed, theWeapon)
break
end
end
end
end)
-- generic cheat detections
RegisterNetEvent(GetCurrentResourceName().. ".verify")
AddEventHandler(GetCurrentResourceName().. ".verify", function()
TriggerServerEvent("AntiCheese:GenericFlag", "Cheating", "Mod Menu Detected (recieved verify event)", true)
end)
RegisterNetEvent("HCheat:TempDisableDetection")
AddEventHandler("HCheat:TempDisableDetection", function()
TriggerServerEvent("AntiCheese:BypassFlag", "Cheating", "Mod Menu Detected (recieved DisableDetection event)", true)
end)
function negativePayFunc(amount)
if amount < 0 then
TriggerServerEvent("AntiCheese:paySpam", "Cheating", "negative payment event.")
end
end
for i, event in pairs(negativePayEvents) do
RegisterNetEvent(event)
AddEventHandler(event, negativePayFunc)
end
-- no longer generic cheat detections
-- specific resource detections
RegisterNetEvent("gcPhone:sendMessage")
AddEventHandler("gcPhone:sendMessage", function(message)
if (string.find(message, "剎車剎車剎車剎車") or -1 > -1) then
TriggerServerEvent("AntiCheese:gcphoneFlag", "Cheating", "GCPhone spam event.", true)
end
end)