[FORK][ESX] Engine Repair kit & Tyre Kit | esx_repairkit V3.2

No error in console.

Config = {}
Config.InfiniteRepairs = false – Should one repairkit last forever?
Config.InfiniteRepairsTyreKit = false – Should one tyrekit last forever?
Config.IfMecaIsOnline = false – Set to true if you don’t want your players to use the RepairKit and TireKit if a mechanic is online
Config.RepairTime = 15 – In seconds, how long should a repair take?
Config.TyreKitTime = 20 – In seconds, how long does it took to replace the tyre?
Config.IgnoreAbort = false – Remove repairkit from inventory even if user aborts repairs?
Config.IgnoreTyreAbort = false – Remove repairkit from inventory even if user aborts repairs?
Config.AllowMecano = false – Allow mechanics to use this repairkit? (If you want this to work set “Config.IfMecaIsOnline” to false, it’s a known bug that will be fixed as soon as possible)
Config.RealisticVehicleFailure = true – Set to true if you are using the resource “RealisticVehicleFailure”
Config.ExplosionOnFailedRepair = true – Set to true if you wan’t to use “Config.ExplosionChance”
Config.ExplosionChance = 100 – The lower it is, the more it has a chance to make the engine fail and the car explode. (1 = 100%, 2 = 50%, 4 = 25%, 10 = 10%, 100 = 1%, etc)
Config.EnableProgressBar = true – If you don’t want a progress bar when your player use the item or you don’t want to use the resource “progressBars” then set it to false

Config.Locale = ‘en’

I’m having the same problem. When I use the repairkit the engine gets repaired for 2 seconds.

SCRIPT ERROR: Execution of native 000000002f7a49e6 in script host failed.

Getting this randomly

image

giving this error when repair finish and remove the repairkit any idea and if we have a fix for this ?

Helo, I have an Issue about i cant USE it i will show you https://gyazo.com/1795fe30ee00c34e97d3fca92d5100b7 any fix please?

Someone Please Help Because the repair kits only work for like a couple seconds then the car is back to damaged state

There is a problem on inv with (local ‘esxItem’) on the repair kit, the tyrekit works but somehow the repairkit is not registered as useable item.

everything works for me but I get a message saying I’m not in front of the engine when i am can i increase the distance so i don’t get that message? and where?
second, while the inventory menu is open when i have repair kit submenu open i press the space bar and it starts fixing the engine but also jumps to the top of the car is there a fixe to make the space bar, not function while using repair kit? the cause space bar is active on the inventory that’s why it does that.
the rest works fine.

suggestion to repair vehicle you would have to hold a wrench for the engine and for tire a crowbar. to make it realistic. I meant to force players like having that tool on hand i would have press a key to start fixing it…
thanks for the release

hey man do u use realisticvehiclefailure if so could u tell me how u got this to work as my car repairs for like 2 seconds then goes to shit

Ok, seems like it would be a very obvious question, how do you get/use repair kits… I installed this mod but have nothing in my inventory, don’t receive any prompts to repair car. Where are the repair kits, how do you use it…

I dont have that installed not even the progress bar. And what you mean your car goes shit?

Well idk where do you get the repairkit or tyrekit but i do /giveitem id repairkit quantity and it gives me the item .
Then ill go to inventory next to the wheel or engine and press use on the inventory.

Hello.
Thanks for your release.
I wanted to ask if this is updated to the latest ESX?
From what I can see, your .sql file is not updated but can be updated easily by anyone what I’m more concerned about is if the actual items will still perform normally with the newest ESX?

still isnt fixed, are you ever going to release an update?

Your database information is in that file! Go ahead in your zap hosting service and change everything, some douche is gonna mess with your database…

Hi this was working untill now. I can only repair a tyre it wont let me repair engine anymore?

Yeah the engine repair kit still dont work i wonder if it has something to do with the progress bar. Ill test it today

Allright it works now just had to install it again

It keep saying not infront off engine, is there anyway to cancel that check?

1 Like

This is the one i use. i have removed the infront of engine check.

RegisterNetEvent(‘esx_repairkit:onUse’)
AddEventHandler(‘esx_repairkit:onUse’, function()
local playerPed = GetPlayerPed(-1)
local coords = GetEntityCoords(playerPed)

if IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then
	local vehicle = nil

	if IsPedInAnyVehicle(playerPed, false) then
		vehicle = GetVehiclePedIsIn(playerPed, false)
	else
		vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71)
	end

	if DoesEntityExist(vehicle) then
		if Config.IgnoreAbort then
			--TriggerServerEvent('esx_repairkit:removeKit')
		end
		SetVehicleDoorOpen(vehicle, 4,0,0)
		TaskStartScenarioInPlace(playerPed, "PROP_HUMAN_BUM_BIN", 0, true)

		Citizen.CreateThread(function()
			ThreadID = GetIdOfThisThread()
			CurrentAction = 'repair'
			exports['progressBars']:startUI(15000, "Forsøger at reparere motoren")
			Citizen.Wait(Config.RepairTime * 1000)
			

			if CurrentAction ~= nil then
                SetVehicleDoorShut(vehicle, 4,0,0)
                SetVehicleEngineOn(vehicle, true, true)
                ClearPedTasksImmediately(playerPed)
                TriggerServerEvent('esx_repairkit:removeKit')
                SetVehicleEngineHealth(vehicle, 500.0)
                SetVehiclePetrolTankHealth(vehicle, 500.0)

				--ESX.ShowNotification(_U('finished_repair'))
				exports['mythic_notify']:DoHudText('inform', 'Du har lavet en hurtig fix af motoren.')
			end


			CurrentAction = nil
			TerminateThisThread()
		end)
	end

	Citizen.CreateThread(function()
		Citizen.Wait(0)

		if CurrentAction ~= nil then
			SetTextComponentFormat('STRING')
			AddTextComponentString(_U('abort_hint'))
			DisplayHelpTextFromStringLabel(0, 0, 1, -1)

			if IsControlJustReleased(0, Keys["X"]) then
				TerminateThread(ThreadID)
				--ESX.ShowNotification(_U('aborted_repair'))
				exports['mythic_notify']:DoHudText('inform', 'Du har afbrydt handlingen.')
				CurrentAction = nil
			end
		end

	end)
else
	--ESX.ShowNotification(_U('no_vehicle_nearby'))
	exports['mythic_notify']:DoHudText('inform', 'Intet køretøj i nærheden.')
end

end)