Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RegisterNetEvent('esx_mecanojob:onFixkit')
- AddEventHandler('esx_mecanojob:onFixkit', 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
- animRunning = true
- TaskStartScenarioInPlace(playerPed, "PROP_HUMAN_BUM_BIN", 0, true)
- TriggerEvent("mythic_progbar:client:progress", {
- name = "repair",
- duration = 20000,
- label = "Repairing Vehicle",
- useWhileDead = false,
- canCancel = true,
- controlDisables = {
- disableMovement = true,
- disableCarMovement = true,
- disableMouse = false,
- disableCombat = true,
- },
- animation = {
- animDict = "missheistdockssetup1clipboard@idle_a",
- anim = "idle_a",
- },
- prop = {
- model = "",
- }
- }, function(status)
- if status then
- Citizen.CreateThread(function()
- SetVehicleFixed(vehicle)
- SetVehicleDeformationFixed(vehicle)
- SetVehicleUndriveable(vehicle, false)
- ClearPedTasksImmediately(playerPed)
- TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'success', text = 'Vehicle Repaired' })
- ESX.ShowNotification(_U('veh_repaired'))
- animRunning = false
- end)
- end
- if not status then
- -- Do Something If Event Wasn't Cancelled
- end
- end)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement