Merge pull request #1385 from Mirrrrrow/main

refactor: used cached esx ped and fixed some lua ls annotations
This commit is contained in:
Gellipapa
2024-07-27 15:40:46 +02:00
committed by GitHub
2 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
local Debug = ESX.GetConfig().EnableDebug
---@param type string the notification type
---@param notificatonType string the notification type
---@param length number the length of the notification
---@param message any the message :D
local function Notify(notificatonType, length, message)
@@ -36,6 +36,7 @@ RegisterNetEvent("ESX:Notify", Notify)
if Debug then
RegisterCommand("oldnotify", function()
---@diagnostic disable-next-line
ESX.ShowNotification("No Waypoint Set.", true, false, 140)
end)
+3 -3
View File
@@ -16,7 +16,7 @@ local function Progressbar(message, length, Options)
end
end
if CurrentProgress.FreezePlayer then
FreezeEntityPosition(PlayerPedId(), CurrentProgress.FreezePlayer)
FreezeEntityPosition(ESX.PlayerData.ped, CurrentProgress.FreezePlayer)
end
SendNUIMessage({
type = "Progressbar",
@@ -30,7 +30,7 @@ local function Progressbar(message, length, Options)
else
ClearPedTasks(ESX.PlayerData.ped)
if CurrentProgress.FreezePlayer then
FreezeEntityPosition(PlayerPedId(), false)
FreezeEntityPosition(ESX.PlayerData.ped, false)
end
if CurrentProgress.onFinish then
CurrentProgress.onFinish()
@@ -50,7 +50,7 @@ local function CancelProgressbar()
})
ClearPedTasks(ESX.PlayerData.ped)
if CurrentProgress.FreezePlayer then
FreezeEntityPosition(PlayerPedId(), false)
FreezeEntityPosition(ESX.PlayerData.ped, false)
end
if CurrentProgress.onCancel then
CurrentProgress.onCancel()