Hello!
I’m using this lockpick script: https://github.com/XxFri3ndlyxX/esx_lockpick
Lockpicking works but when i get into the car it starts the jammed handbrake/hotwire animation and it gets stuck there, can’t move, cant cancel , can’t get out of the car.
This is the main function:
--//////////////////////////////////////////////--
-- MAIN FUNCTION --
--//////////////////////////////////////////////--
RegisterNetEvent('esx_lockpick:onUse')
AddEventHandler('esx_lockpick: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_lockpick:removeKit')
end
Citizen.Wait(1000)
RequestAnimDict('anim@amb@clubhouse@tutorial@bkr_tut_ig3@')
while not HasAnimDictLoaded('anim@amb@clubhouse@tutorial@bkr_tut_ig3@') do
Citizen.Wait(0)
end
TaskPlayAnim(GetPlayerPed(-1), 'anim@amb@clubhouse@tutorial@bkr_tut_ig3@' , 'machinic_loop_mechandplayer' ,8.0, -8.0, -1, 1, 0, false, false, false )
exports['mythic_progbar']:Progress({
name = "Lockpicking",
duration = Config.LockTime * 1000,
label = "Incerci sa spargi vehiculul",
useWhileDead = false,
canCancel = true,
controlDisables = {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true,
},
animation = {
animDict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@",
anim = "machinic_loop_mechandplayer",
flags = 49,
},
}, function(status)
if not status then
cancel = false
exports.pNotify:SendNotification({
text = (_U('lockpicked_successful')),
type = "success",
timeout = 1000,
layout = "centerRight",
queue = "right",
killer = false,
animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}
})
else
cancel = true
end
end)
Citizen.Wait(1000)
Citizen.CreateThread(function()
ThreadID = GetIdOfThisThread()
CurrentAction = 'lockpick'
local chance = lockpickchance()
if chance == true then
if Config.CallCops then
local randomReport = math.random(1, Config.CallCopsPercent)
print(Config.CallCopsPercent)
if randomReport == Config.CallCopsPercent then
TriggerServerEvent('esx_lockpick:Notify')
end
end
Citizen.Wait(Config.LockTime * 1000)
if CurrentAction ~= nil then
if not cancel then
SetVehicleAlarm(vehicle, true)
SetVehicleAlarmTimeLeft(vehicle, Config.AlarmTime * 1000)
SetVehicleDoorsLocked(vehicle, 1)
SetVehicleDoorsLockedForAllPlayers(vehicle, false)
ClearPedTasksImmediately(playerPed)
exports.pNotify:SendNotification({
text = (_U('vehicle_unlocked')),
type = "success",
timeout = 1000,
layout = "centerRight",
queue = "right",
killer = false,
animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}
})
SetVehicleNeedsToBeHotwired(vehicle, true)
IsVehicleNeedsToBeHotwired(vehicle)
TaskEnterVehicle(playerPed, vehicle, 10.0, -1, 1.0, 1, 0)
Wait(2000)
TriggerEvent("mythic_progressbar:client:progress", {
name = "Unjamming_Handbrakes",
duration = Config.JammedHandbrakeTime * 1000,
label = "Unjamming Handbrakes In Progress",
useWhileDead = false,
canCancel = true,
controlDisables = {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true,
},
animation = {
animDict = "veh@std@ds@base",
anim = "hotwire",
},
}, function(status)
if not status then
exports.pNotify:SendNotification({
text = (_U('unjammed_handbrake')),
type = "success",
timeout = 1000,
layout = "centerRight",
queue = "right",
killer = false,
animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}
})
end
end)
end
end
else
if Config.CallCops then
local randomReport = math.random(1, Config.CallCopsPercent)
print(Config.CallCopsPercent)
if randomReport == Config.CallCopsPercent then
TriggerServerEvent('esx_lockpick:Notify')
end
end
Citizen.Wait(Config.LockTime * 1000)
ClearPedTasksImmediately(playerPed)
ESX.ShowNotification(_U('picklock_failed'))
if not Config.IgnoreAbort then
TriggerServerEvent('esx_lockpick:removeKit')
end
CurrentAction = nil
TerminateThisThread()
end
end)
end
Citizen.CreateThread(function()
Citizen.Wait(0)
if CurrentAction ~= nil then
SetTextComponentFormat('STRING')
AddTextComponentString(_U('abort_hint'))
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
if IsControlJustPressed(0, 178) then
TerminateThread(ThreadID)
ESX.ShowNotification(_U('aborted_lockpicking'))
CurrentAction = nil
end
end
end)
else
ESX.ShowNotification(_U('no_vehicle_nearby'))
end
end)
OR Here is my client/main.lua file
main.lua (15.7 KB)
And 1 more thing: the cancel button is set to DELETE button, when i press it the progress bar says canceled but gets stuck into the lockpick animation and the pop-up message to stop the action is wrong: it says press E but it’s set to DEL. This is what’s in the locales file:
['abort_hint'] = 'Apasa ~INPUT_CONTEXT~ sa te opresti.'
Kind regards,
MaguHD
