A simple anti cheat that uses decoring system in GTA V to block unauthorised car/object spawns

Well, this anti cheat was my private anti cheat but some people stole it and sold it to others… so here it is.

Features:

  • Check all vehicles & objects every x ms ( can be changed via convar, default 100ms, more on that later )
  • Check all peds and remove those that have weapons drawn out. This is a feature that helps blocking cheaters from dropping f…king SWAT teams with RPGs… ( can be enabled, default = disabled )

Setting it up:

Well this is the hard part for non-experienced server owners because it requires some lua knowledge. I’ll give an example anyways.

Let’s say we have an ESX RP server up and running but hackers are pwning our ass via throwing planes at our head with mod menus such as Riptide or Matrix.

Go to: es_extended/client/functions.lua
Put these on top of the file:


local decorName = nil
local decorInt = nil
RegisterNetEvent("dexac:HereAreYourDecors")
AddEventHandler("dexac:HereAreYourDecors", function( decorN, decorI)
	decorName = decorN
	decorInt = decorI
end)

Find: ESX.Game.SpawnVehicle
Find: local vehicle = CreateVehicle(model, coords.x, coords.y, coords.z, heading, true, false)
Put to next line: DecorSetInt(vehicle,decorName,decorInt)

Find: ESX.Game.SpawnLocalVehicle
Find: local vehicle = CreateVehicle(model, coords.x, coords.y, coords.z, heading, true, false)
Put to next line: DecorSetInt(vehicle,decorName,decorInt)

Find: ESX.Game.SpawnObject
Find: local obj = CreateObject(model, coords.x, coords.y, coords.z, true, true, true)
Put to next line: DecorSetInt(vehicle,decorName,decorInt)

Find: ESX.Game.SpawnLocalObject
Find: local obj = CreateObject(model, coords.x, coords.y, coords.z, true, true, true)
Put to next line: DecorSetInt(vehicle,decorName,decorInt)

After editing the files that has CreateVehicle or CreateObject functions put DexAC folder to your resources folder and put “start DexAC” to the BOTTOM of your server.cfg. There are some convars you might want to change. Should you choose to use the convars, put them AT THE TOP of your server.cfg.

Another Example to help you implement this into any script: GO!

Convars:

set DexAC_DecorName "WohoooDecorNameee" # Decor Name, change this.
set DexAC_DecorINT "1337" # Decor Int, change this.
set DexAC_PedChecking "false" # or true -- Ped Checking 
set DexAC_CheckSpeed "100" # checking interval ( its in ms ) -- it will drain cpus so be careful with this setting

Download:

Source Code ( C# )
Latest Release ( 1.0.0.0 )

Notes:

Thank you @Blumlaut, for giving this idea to me.
I won’t help you figure out how this works, get to work and learn some C#-Lua if you want to use this thing.
This may or may not be bad. I don’t know. I am just releasing this to stop people from selling this sh*tty 50 lines of code.

Also feel free to send pulls or open issues on Github.

Discord: Dexelir#1019

10 Likes

Hi,
Nice to share it, they can’t sell it now
Thanks you a lot

1 Like

Is this just for ESX servers?

@Zach_Wills you can implement this into anything.

Hi @Dexelir

Thanks dude , great work :metal:

1 Like

Check out my salty_tokenizer script and consider sending the decors through an obfuscated client event, which would prevent cheaters from listening for the decors themselves and spawning new vehicles with the appropriate decors. This is what I do on my server currently.

Thanks for sharing. It’s sure to be helpful.

The reason why start DexAC should be at the bottom is it only fires this event once, when the client boots up. So no need for that since it won’t fire a second time unless server owner restarts DexAC.

That’s how mine works too, and I agree with you. But I was told that a Lua injector can have listeners as they join. So I made untracable client events just in case that is true.

LUA Engine inits when you actually join the server… like… your ordinary troll would not be able to do that.

Are there any great pen-testers with C++ knowledge around that would try this out for us? :3

I’m a web pentester. Unfortunately only rough C++ knowledge. :confused: Mainly a PHP guy. But I do plan on testing some stuff client side. I want to see if there’s a way to get the “okay” to experiment without getting a global ban.

@nitrogen I can imagine you hate being tagged buuuut…

is there’s a way to get the “okay” to experiment with cheats to build anti-cheats without getting a global ban?

I sent an email to pr@fivem.net to see what to do.

1 Like

Good idee. i think one anti-cheat who checking the players game before connecting on the serveur if his/her files have a cheat they can’t join the serveur…

Hey dexelir i managed to get it to work for esx.vehicle spawn function (as per your tutorial)
Wondering if i can get some help implementing it to a different script :o

Well try to understand what is going on in my tutorial then you can implement DexAC into every script you want to use. I will give you an another example because I have nothing to do right now xD:

Lets assume that we have a script that only spawns T20 then paints it red. It would look like this:

function createcarformepls()
 local t20VehicleorAnyOtherName = CreateVehicle(GetHashKey("t20"),1.0,1.0,1.0,1.0,false,false)
 SetVehicleCustomPrimaryColour(t20VehicleorAnyOtherName,255,0,0)
end

do you see how CreateVehicle is stored in the local “t20VehicleorAnyOtherName”?

If I want to make this car bypass DexAC, I need to do this:

local decorName = nil
local decorInt = nil
RegisterNetEvent("dexac:HereAreYourDecors")
AddEventHandler("dexac:HereAreYourDecors", function( decorN, decorI)
	decorName = decorN
	decorInt = decorI
end)

function createcarformepls()
 local t20VehicleorAnyOtherName = CreateVehicle(GetHashKey("t20"),1.0,1.0,1.0,1.0,false,false)
 DecorSetInt(t20VehicleorAnyOtherName ,decorName,decorInt)
 SetVehicleCustomPrimaryColour(t20VehicleorAnyOtherName,255,0,0)
end

As you can see I only changed

DecorSetInt(vehicle,decorName,decorInt)

to

DecorSetInt(t20VehicleorAnyOtherName ,decorName,decorInt)

because CreateVehicle has stored the vehicle into the local t20VehicleorAnyOtherName.

Try to understand this example and re-create it for every script you want to use with DexAC.

1 Like

THanks for the reply!
I actually figured this out before your reply, amazing script :slight_smile:

1 Like

Can I bump my thread? Is that even allowed? I don’t know. I shall learn by bumping it.

What even is the point of bumping it, if people are genuinely interested they would either find it by searching or just having it by chance show up somewhere, there’s no real need to bump it especially when the search feature exists.

Well a bloody c*nt sells this piece of crap. I bump it so even an idiot can see&download it.

Hey dexelir! Looking for some help :slight_smile:
trying to integrate this script:
https://forum.cfx.re/t/release-police-interaction-script/
however it seems to be conflicting with dexac, Vehicle seems to disappear when we pull over.
i am trying to find the place to add the code in.
Let me know if you find what it would be