Anti Ped, Vehicle, Prop/Object | (Auto Remover/Blacklist)

Hello. I’ve created 3 simple resources to automatically remove specified peds, props, and vehicles. This should help against cheaters/modders trying to harm your server experience :slight_smile:

AntiPed: https://github.com/ATG-Github/atg-antiped
AntiCar: https://github.com/ATG-Github/atg-anticar
AntiProp: https://github.com/ATG-Github/antiprop

To add new things to the blacklist, all you have to do is add it to the config just like the other ones :slight_smile:. I’ll accept any PRs that will improve the quality/effectiveness of the script(s).

Thank You, have a nice day!



If you’re running ESX, make sure to check out my ESX exploit fixes!

5 Likes

There is a much better way of doing this if using OneSync. Simply do the following serverside.

local blockedItems = {
	[`jester`] = true,
	[`hydra`] = true,
	[`stt_prop_track_tube_01`] = true,
	[`stt_prop_wallride_45l`] = true,
	[`ig_wade`] = true,
}

AddEventHandler('entityCreating', function(entity)
	local model = GetEntityModel(entity)
	if blockedItems[model] then
		CancelEvent()
	end
end)

You can put peds, props and cars all in the one table and it’ll take care of it all.

10 Likes

Interesting… However, this does require 1S as well as (I assume [any idea which build btw?]) a newer server build (which, for some reason people don’t even know exist). I might think of a way to check if running 1S to use that code and funnel that to the client to determine whether or not to run the client script or not based on 1S status.
Thanks for the insight :slight_smile:

It’s been in OneSync for a very very long time. If people want security they should be keeping updated. And honestly if people aren’t running OneSync they shouldn’t be using FiveM. It’s on by default now and I think it’s stupid to not use it and people shouldn’t be basing scripts around people not using it anymore.

3 Likes

:rofl: good to know. I’ll look into it and try to figure out about when it came out to at least warn them if they don’t have it. Thanks again!

2 Likes

Thanks dude for this

Would just need a config option to enable one sync support. Then do whatever one sync code while its true and whatever non one sync while its false.

Hey I like the resource but can you add a feature that peds are not allowed to carry weapons? Most of the modders spawn aggressive npcs with weapons.

I can’t find the script but someone before made it so if the npcs are holding a blacklisted weapons it would set their health to 0 to kill em. Could be something

1 Like

If you could find it for me that would be very nice!

(Noob question) This function works in any part of a “server side” script? For example, in case i have a script which control the traffic in the server, i can add this function in it and it will work if i have OneSync in my server?

Thank you in advance :slight_smile:

And good work @ATG, it’s a cool and easy way to keep the control of the Peds, Cars and Props who we doesn’t want to have in the server ^^

Put this in a client, so the peds won’t shoot

local relationshipTypes = {
	'GANG_1',
	'GANG_2',
	'GANG_9',
	'GANG_10',
	'AMBIENT_GANG_LOST',
	'AMBIENT_GANG_MEXICAN',
	'AMBIENT_GANG_FAMILY',
	'AMBIENT_GANG_BALLAS',
	'AMBIENT_GANG_MARABUNTE',
	'AMBIENT_GANG_CULT',
	'AMBIENT_GANG_SALVA',
	'AMBIENT_GANG_WEICHENG',
	'AMBIENT_GANG_HILLBILLY',
	'DEALER',
	'COP',
	'PRIVATE_SECURITY',
	'SECURITY_GUARD',
	'ARMY',
	'MEDIC',
	'FIREMAN',
	'HATES_PLAYER',
	'NO_RELATIONSHIP',
	'SPECIAL',
	'MISSION2',
	'MISSION3',
	'MISSION4',
	'MISSION5',
	'MISSION6',
	'MISSION7',
	'MISSION8'
}

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(5000)

		for _, group in ipairs(relationshipTypes) do
			SetRelationshipBetweenGroups(1, GetHashKey('PLAYER'), GetHashKey(group)) -- could be removed
			SetRelationshipBetweenGroups(1, GetHashKey(group), GetHashKey('PLAYER'))
		end
	end
end)
1 Like