mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 09:48:52 +00:00
refactor(esx_multicharacter): correction of lint errors
This commit is contained in:
@@ -12,7 +12,7 @@ if ESX.GetConfig().Multichar then
|
||||
if NetworkIsPlayerActive(PlayerId()) then
|
||||
exports.spawnmanager:setAutoSpawn(false)
|
||||
DoScreenFadeOut(0)
|
||||
while not GetResourceState('esx_context') == 'started' do
|
||||
while GetResourceState('esx_context') ~= 'started' do
|
||||
Wait(100)
|
||||
end
|
||||
TriggerEvent("esx_multicharacter:SetupCharacters")
|
||||
@@ -150,7 +150,7 @@ if ESX.GetConfig().Multichar then
|
||||
{title = TranslateCap('return'), unselectable = false, icon = "fa-solid fa-arrow-left", description = TranslateCap('char_delete_no_description'), action = "return"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("left", elements, function(element, Action)
|
||||
ESX.OpenContext("left", elements, function(_, Action)
|
||||
if Action.action == "delete" then
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_multicharacter:DeleteCharacter', Action.value)
|
||||
@@ -170,7 +170,7 @@ if ESX.GetConfig().Multichar then
|
||||
elements[3] = {title = TranslateCap('char_disabled'), value = SelectedCharacter.value, icon ="fa-solid fa-xmark", description = TranslateCap('char_disabled_description'),}
|
||||
end
|
||||
if Config.CanDelete then elements[4] = {title = TranslateCap('char_delete'),icon ="fa-solid fa-xmark",description = TranslateCap('char_delete_description'), action = 'delete', value = SelectedCharacter.value} end
|
||||
ESX.OpenContext("left", elements, function(element, Action)
|
||||
ESX.OpenContext("left", elements, function(_, Action)
|
||||
if Action.action == "play" then
|
||||
SendNUIMessage({
|
||||
action = "closeui"
|
||||
@@ -204,7 +204,7 @@ if ESX.GetConfig().Multichar then
|
||||
elements[#elements+1] = {title = TranslateCap('create_char'), icon = "fa-solid fa-plus", value = (#elements+1), new = true}
|
||||
end
|
||||
|
||||
ESX.OpenContext("left", elements, function(menu, SelectedCharacter)
|
||||
ESX.OpenContext("left", elements, function(_, SelectedCharacter)
|
||||
if SelectedCharacter.new then
|
||||
ESX.CloseContext()
|
||||
local GetSlot = function()
|
||||
@@ -321,7 +321,7 @@ if ESX.GetConfig().Multichar then
|
||||
end)
|
||||
|
||||
if Config.Relog then
|
||||
RegisterCommand('relog', function(source, args, rawCommand)
|
||||
RegisterCommand('relog', function()
|
||||
if canRelog then
|
||||
canRelog = false
|
||||
TriggerServerEvent('esx_multicharacter:relog')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
ESX.RegisterCommand('setslots', 'admin', function(xPlayer, args, showError)
|
||||
ESX.RegisterCommand('setslots', 'admin', function(xPlayer, args)
|
||||
local slots = MySQL.scalar('SELECT `slots` FROM `multicharacter_slots` WHERE identifier = ?', {
|
||||
args.identifier
|
||||
})
|
||||
@@ -21,7 +21,7 @@ end, true, {help = TranslateCap('command_setslots'), validate = true, arguments
|
||||
{name = 'slots', help = TranslateCap('command_slots'), type = 'number'}
|
||||
}})
|
||||
|
||||
ESX.RegisterCommand('remslots', 'admin', function(xPlayer, args, showError)
|
||||
ESX.RegisterCommand('remslots', 'admin', function(xPlayer, args)
|
||||
local slots = MySQL.scalar('SELECT `slots` FROM `multicharacter_slots` WHERE identifier = ?', {
|
||||
args.identifier
|
||||
})
|
||||
@@ -36,7 +36,7 @@ end, true, {help = TranslateCap('command_remslots'), validate = true, arguments
|
||||
{name = 'identifier', help = TranslateCap('command_identifier'), type = 'string'}
|
||||
}})
|
||||
|
||||
ESX.RegisterCommand('enablechar', 'admin', function(xPlayer, args, showError)
|
||||
ESX.RegisterCommand('enablechar', 'admin', function(xPlayer, args)
|
||||
|
||||
local selectedCharacter = 'char'..args.charslot..':'..args.identifier;
|
||||
|
||||
@@ -55,7 +55,7 @@ end, true, {help = TranslateCap('command_enablechar'), validate = true, argument
|
||||
{name = 'charslot', help = TranslateCap('command_charslot'), type = 'number'}
|
||||
}})
|
||||
|
||||
ESX.RegisterCommand('disablechar', 'admin', function(xPlayer, args, showError)
|
||||
ESX.RegisterCommand('disablechar', 'admin', function(xPlayer, args)
|
||||
|
||||
local selectedCharacter = 'char'..args.charslot..':'..args.identifier;
|
||||
|
||||
@@ -74,6 +74,6 @@ end, true, {help = TranslateCap('command_disablechar'), validate = true, argumen
|
||||
{name = 'charslot', help = TranslateCap('command_charslot'), type = 'number'}
|
||||
}})
|
||||
|
||||
RegisterCommand('forcelog', function(source, args, rawCommand)
|
||||
RegisterCommand('forcelog', function(source)
|
||||
TriggerEvent('esx:playerLogout', source)
|
||||
end, true)
|
||||
|
||||
@@ -96,7 +96,7 @@ end
|
||||
TriggerClientEvent('esx_multicharacter:SetupUI', source, characters, slots)
|
||||
end
|
||||
|
||||
AddEventHandler('playerConnecting', function(playerName, setKickReason, deferrals)
|
||||
AddEventHandler('playerConnecting', function(_, _, deferrals)
|
||||
deferrals.defer()
|
||||
local identifier = GetIdentifier(source)
|
||||
if oneSyncState == "off" or oneSyncState == "legacy" then
|
||||
@@ -234,7 +234,7 @@ end
|
||||
ESX.Players[GetIdentifier(source)] = true
|
||||
end)
|
||||
|
||||
AddEventHandler('playerDropped', function(reason)
|
||||
AddEventHandler('playerDropped', function()
|
||||
awaitingRegistration[source] = nil
|
||||
ESX.Players[GetIdentifier(source)] = nil
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user