print("[cloudfivem.com - m3_ac] - Anticheat Started!")
RegisterNetEvent("cloudfivem_ac:client:deleteEntitiesfromServerID")
AddEventHandler("cloudfivem_ac:client:deleteEntitiesfromServerID", function(a)
for fe, fg in pairs(GetAllEnumerators()) do
for fm in fg() do
if GetPlayerServerId((NetworkGetEntityOwner(fm))) == a or a == false then
if GetEntityType(fm) == 1 then
if isPedBlacklisted(fm) then
NetworkDelete(fm)
end
elseif GetEntityType(fm) == 2 then
if isVehBlacklisted(fm) then
NetworkDelete(fm)
end
elseif GetEntityType(fm) == 3 and isPropBlacklisted(fm) then
NetworkDelete(fm)
end
end
end
end
end)
function isPropBlacklisted(a)
for fe, fg in pairs(Config.WhitelistObjects) do
if GetEntityModel(a) == GetHashKey(fg) then
return false
end
end
return true
end
function isVehBlacklisted(a)
for fe, fg in pairs(Config.BlacklistVehicles) do
if GetEntityModel(a) == GetHashKey(fg) then
return true
end
end
return false
end
function isPedBlacklisted(a)
for fe, fg in pairs(Config.BlacklistPeds) do
if GetEntityModel(a) == GetHashKey(fg) then
return true
end
end
return false
end
function NetworkDelete(a)
if DoesEntityExist(a) and (not IsEntityAPed(a) or not IsPedAPlayer(a)) then
DetachEntity(a, 0, false)
SetEntityCollision(a, false, false)
SetEntityAlpha(a, 0, true)
SetEntityAsMissionEntity(a, false, true)
DeleteEntity(a)
end
end
Citizen.CreateThread(function()
SetEntityProofs(PlayerPedId(), 0, 1, 0, 0, 0, 1, 1, 0)
for fd, fe in pairs(Config.Events) do
if Config.TriggerDetection then
RegisterNetEvent(tostring(fe))
AddEventHandler(tostring(fe), function()
if Config.BlacklistEventLog then
TriggerServerEvent("cloudfivem_ac:server:dclog", "Blacklisted event kullandi! Client Event: " .. va)
end
if Config.BlacklistEventDrop then
TriggerServerEvent("cloudfivem_ac:server:drop")
end
end)
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(Config.CheckBLWeaponTimeOut)
if isWeaponBlacklisted(GetCurrentPedWeapon(PlayerPedId(), true)) then
RemoveWeaponFromPed(PlayerPedId(), GetCurrentPedWeapon(PlayerPedId(), true))
if Config.BlacklistWeaponLog then
TriggerServerEvent("cloudfivem_ac:server:dclog", "Blacklist silah kullandi! Silah: " .. isWeaponBlacklisted(GetCurrentPedWeapon(PlayerPedId(), true)))
end
if Config.BlacklistWeaponDrop then
TriggerServerEvent("cloudfivem_ac:server:drop")
end
end
end
end)
AddEventHandler("onClientResourceStop", function(a)
if Config.StopResourceLog then
TriggerServerEvent("cloudfivem_ac:server:dclog", "Script durdurdu! Script adi: **" .. a .. "**")
end
if Config.StopResourceDrop then
TriggerServerEvent("cloudfivem_ac:server:drop")
end
end)
function isWeaponBlacklisted(a)
for fe, fg in pairs(Config.BlacklistedWeapons) do
if a == GetHashKey(fg) then
return true, fg
end
end
return false, nil
end
if Config.DisableRam then
Citizen.CreateThread(function()
while true do
Citizen.Wait(30)
for fd in EnumerateVehicles() do
if GetPedInVehicleSeat(fd, -1) == 0 and 20 < GetEntitySpeed(fd) then
NetworkDelete(fd)
end
end
end
end)
end
function DisplayEntityInformation(a)
Draw3DText(("~g~Oyun Objesi~w~" .. [[
~r~Obje ID:~w~ ]] .. a) .. [[
~y~Obje Modeli(Hash):~w~ ]] .. GetEntityModel(a) .. "", 100, GetEntityCoords(a))
end
RegisterCommand("ac_entityinfo", function()
va = not va
if va then
repeat
Citizen.Wait(0)
if va then
for fd, fe in pairs(GetAllEnumerators()) do
for fl in fe() do
DisplayEntityInformation(fl)
end
end
end
until not va
end
end, false)
function Draw3DText(a, b, c)
if b > Vdist2(GetEntityCoords(PlayerPedId(), false), c.x, c.y, c.z) and World3dToScreen2d(c.x, c.y, c.z) then
SetTextScale(tonumber(1), tonumber(0.35))
SetTextFont(0)
SetTextProportional(true)
SetTextColour(255, 255, 255, 255)
SetTextOutline()
SetTextEntry("STRING")
SetTextCentre(true)
AddTextComponentString(a)
DrawText(World3dToScreen2d(c.x, c.y, c.z))
end
end
function EnumerateObjects()
return va(FindFirstObject, FindNextObject, EndFindObject)
end
function EnumeratePeds()
return va(FindFirstPed, FindNextPed, EndFindPed)
end
function EnumerateVehicles()
return va(FindFirstVehicle, FindNextVehicle, EndFindVehicle)
end
function GetAllEnumerators()
return {
vehicles = EnumerateVehicles,
objects = EnumerateObjects,
peds = EnumeratePeds
}
end
RegisterNetEvent("esx:playerLoaded")
AddEventHandler("esx:playerLoaded", function(a)
va = true
end)
AddEventHandler("playerSpawned", function()
Citizen.CreateThread(function()
while not va do
Citizen.Wait(100)
end
if vb then
vb = false
AddEventHandler("esx:getSharedObject", function()
if Config.GetSharedObjectLog then
TriggerServerEvent("cloudfivem_ac:server:dclog", "Sunucuya baglandiktan sonra ESX kutuphanesi istendi. Menu enjektesi olabilir.")
end
if Config.GetSharedObjectDrop then
TriggerServerEvent("cloudfivem_ac:server:drop")
end
end)
end
end)
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(Config.SpectateCheckTimeout * 1000)
if NetworkIsInSpectatorMode() then
if Config.AntiSpectateLog then
TriggerServerEvent("cloudfivem_ac:server:dclog", "Spectate yakalandi.")
end
if Config.AntiSpectateDrop then
TriggerServerEvent("cloudfivem_ac:server:drop")
end
end
end
end)