diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index cb8c7bba8..fc1f9e2e5 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -51,4 +51,5 @@ 26. [esx_status/server]: fix: unused argument @bitpredator 27. [esx_addoninventory]: chore: check for nil society @bitpredator 28. [npwd]: chore: npwd update to version 1.8.6 @bitpredator -29. [bpt_deliveries]: chore: clean up the code @bitpredator \ No newline at end of file +29. [bpt_deliveries]: chore: clean up the code @bitpredator +30. [esx-radialmenu]: chore: fix lint error + clean up the code @bitpredator \ No newline at end of file diff --git a/server-data/resources/[esx_addons]/esx-radialmenu/client/main.lua b/server-data/resources/[esx_addons]/esx-radialmenu/client/main.lua index 31405166a..6fb17ff6a 100644 --- a/server-data/resources/[esx_addons]/esx-radialmenu/client/main.lua +++ b/server-data/resources/[esx_addons]/esx-radialmenu/client/main.lua @@ -41,7 +41,7 @@ local function getNearestVeh() local pos = GetEntityCoords(PlayerPedId()) local entityWorld = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 20.0, 0.0) local rayHandle = CastRayPointToPoint(pos.x, pos.y, pos.z, entityWorld.x, entityWorld.y, entityWorld.z, 10, PlayerPedId(), 0) - local _, _, _, _, vehicleHandle = GetRaycastResult(rayHandle) + local vehicleHandle = GetRaycastResult(rayHandle) return vehicleHandle end @@ -250,7 +250,7 @@ RegisterKeyMapping('radialmenu', _U("command_description"), 'keyboard', Config. -- Events -- Sets the metadata when the player spawns -RegisterNetEvent('esx:playerLoaded', function(xPlayer, isNew) +RegisterNetEvent('esx:playerLoaded', function(xPlayer) ESX.PlayerData = xPlayer ESX.PlayerLoaded = true end) @@ -360,25 +360,7 @@ RegisterNetEvent('esx-radialmenu:client:ChangeSeat', function(data) end end) -RegisterNetEvent('esx-radialmenu:flipVehicle', function() - TriggerEvent('animations:client:EmoteCommandStart', {"mechanic"}) - QBCore.Functions.Progressbar("pick_grape", _U("progress.flipping_car"), Config.Fliptime, false, true, { - disableMovement = true, - disableCarMovement = true, - disableMouse = false, - disableCombat = true, - }, {}, {}, {}, function() -- Done - local vehicle = getNearestVeh() - SetVehicleOnGroundProperly(vehicle) - TriggerEvent('animations:client:EmoteCommandStart', {"c"}) - end, function() -- Cancel - ESX.ShowNotification( _U("task.cancel_task"), "error") - TriggerEvent('animations:client:EmoteCommandStart', {"c"}) - end) -end) - -- NUI Callbacks - RegisterNUICallback('closeRadial', function(data, cb) setRadialState(false, false, data.delay) cb('ok') @@ -396,12 +378,10 @@ RegisterNUICallback('selectItem', function(inData, cb) TriggerServerEvent(data.event, data) elseif data.type == 'command' then ExecuteCommand(data.event) - -- elseif data.type == 'qbcommand' then - -- TriggerServerEvent('QBCore:CallCommand', data.event, data) end end cb('ok') end) exports('AddOption', AddOption) -exports('RemoveOption', RemoveOption) +exports('RemoveOption', RemoveOption) \ No newline at end of file diff --git a/server-data/resources/[esx_addons]/esx-radialmenu/client/trunk.lua b/server-data/resources/[esx_addons]/esx-radialmenu/client/trunk.lua index cb564723e..c02b87ebd 100644 --- a/server-data/resources/[esx_addons]/esx-radialmenu/client/trunk.lua +++ b/server-data/resources/[esx_addons]/esx-radialmenu/client/trunk.lua @@ -23,7 +23,6 @@ local disabledTrunk = { } -- Functions - local function DrawText3Ds(x, y, z, text) SetTextScale(0.35, 0.35) SetTextFont(4) @@ -44,7 +43,7 @@ local function getNearestVeh() local entityWorld = GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 20.0, 0.0) local rayHandle = CastRayPointToPoint(pos.x, pos.y, pos.z, entityWorld.x, entityWorld.y, entityWorld.z, 10, PlayerPedId(), 0) - local _, _, _, _, vehicleHandle = GetRaycastResult(rayHandle) + local vehicleHandle = GetRaycastResult(rayHandle) return vehicleHandle end @@ -70,7 +69,6 @@ local function TrunkCam(bool) end -- Events - RegisterNetEvent('esx_kidnapping:client:SetKidnapping', function(bool) isKidnapping = bool end) @@ -207,7 +205,6 @@ RegisterNetEvent('esx-trunk:client:GetIn', function() end) -- Threads - CreateThread(function() while true do local sleep = 1000 diff --git a/server-data/resources/[esx_addons]/esx-radialmenu/fxmanifest.lua b/server-data/resources/[esx_addons]/esx-radialmenu/fxmanifest.lua index 009d5b1ca..ca665f4a5 100644 --- a/server-data/resources/[esx_addons]/esx-radialmenu/fxmanifest.lua +++ b/server-data/resources/[esx_addons]/esx-radialmenu/fxmanifest.lua @@ -13,16 +13,12 @@ shared_scripts { client_scripts { 'locales/*.lua', - 'client/main.lua', - 'client/clothing.lua', - 'client/trunk.lua', - 'client/stretcher.lua' + 'client/*.lua', } server_scripts { 'locales/*.lua', - 'server/trunk.lua', - 'server/stretcher.lua' + 'server/*.lua', } files { @@ -30,5 +26,4 @@ files { 'html/css/main.css', 'html/js/main.js', 'html/js/RadialMenu.js', -} - +} \ No newline at end of file diff --git a/server-data/resources/[esx_addons]/esx-radialmenu/server/trunk.lua b/server-data/resources/[esx_addons]/esx-radialmenu/server/trunk.lua index be8a8e6af..e074e36af 100644 --- a/server-data/resources/[esx_addons]/esx-radialmenu/server/trunk.lua +++ b/server-data/resources/[esx_addons]/esx-radialmenu/server/trunk.lua @@ -12,15 +12,15 @@ RegisterNetEvent('esx-trunk:server:KidnapTrunk', function(targetId, closestVehic TriggerClientEvent('esx-trunk:client:KidnapGetIn', targetId, closestVehicle) end) -ESX.RegisterServerCallback('esx-trunk:server:getTrunkBusy', function(src, cb, plate) +ESX.RegisterServerCallback('esx-trunk:server:getTrunkBusy', function(_, cb, plate) if trunkBusy[plate] then cb(true) return end cb(false) end) -ESX.RegisterCommand({"getintrunk"}, 'user', function(xPlayer, args, showError) +ESX.RegisterCommand({"getintrunk"}, 'user', function(xPlayer) TriggerClientEvent('esx-trunk:client:GetIn', xPlayer.source) end, false, {help = _U("getintrunk_command_desc")}) -ESX.RegisterCommand({"putintrunk"}, 'user', function(xPlayer, args, showError) +ESX.RegisterCommand({"putintrunk"}, 'user', function(xPlayer, args) TriggerClientEvent('esx-trunk:server:KidnapTrunk', xPlayer.source) end, false, {help = _U("putintrunk_command_desc")}) \ No newline at end of file