Shopping Cart
11abac85b780a6bfb422bb414511bacab31e72a7

[How to] kill player if combat logging with esx_ambulancejob – Modding Tutorials

FiveM Modding Tutorial

First open up the client/main.lua in esx_ambulancejob folder and find this:

if FirstSpawn then
	exports.spawnmanager:setAutoSpawn(false) – disable respawn
	FirstSpawn = false

	ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead)
		if isDead and Config.AntiCombatLog then
			while not PlayerLoaded do
				Citizen.Wait(1000)
			end

			ESX.ShowNotification(_U('combatlog_message'))
			RemoveItemsAfterRPDeath()
		end
	end)
end

end)

and replace with this:

if firstSpawn then
	firstSpawn = false

	if Config.AntiCombatLog then
		while not PlayerLoaded do
			Citizen.Wait(5000)
		end

		ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(shouldDie)
			if shouldDie then
				Citizen.Wait(10000)
				SetEntityHealth(PlayerPedId(), 0)
			end
		end)
	end
end

end)

When the player spawns in it will take a couple of seconds so that the player skin loads and will then kill them.

I hope this helps out people who have been looking on how to stop people combat logging :smiley:

OR if you find it easier you can go to my GitHub and download the whole script there.

Leave a Reply
FiveM ESX Scripts

The best scripts and maps

Best support

Problems? We are there to help!

Wide range of products

We have a wide range of products

100% Secure Checkout

Easy and encrypted