refactor: more logical code

This commit is contained in:
MoskalykA
2023-03-01 10:04:48 +01:00
parent a80f5f952a
commit b8e29f6538
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ function ESX.RegisterCommand(name, group, cb, allowConsole, suggestion)
end
end
if v.validate == false then
if not v.validate then
error = nil
end
+1 -1
View File
@@ -29,7 +29,7 @@ CreateThread(function()
})
for k,v in pairs(OpenedMenus) do
if v == true then
if v then
OpenedMenuCount = OpenedMenuCount + 1
end
end
+3 -3
View File
@@ -95,7 +95,7 @@ if ESX.GetConfig().Multichar then
end
SetupCharacter = function(index)
if spawned == false then
if not spawned then
exports.spawnmanager:spawnPlayer({
x = Config.Spawn.x,
y = Config.Spawn.y,
@@ -188,7 +188,7 @@ if ESX.GetConfig().Multichar then
if not v.model and v.skin then
if v.skin.model then v.model = v.skin.model elseif v.skin.sex == 1 then v.model = mp_f_freemode_01 else v.model = mp_m_freemode_01 end
end
if spawned == false then SetupCharacter(Character) end
if not spawned then SetupCharacter(Character) end
local label = v.firstname..' '..v.lastname
if Characters[k].disabled then
elements[#elements+1] = {title = label,icon = "fa-regular fa-user", value = v.id}
@@ -318,7 +318,7 @@ if ESX.GetConfig().Multichar then
if Config.Relog then
RegisterCommand('relog', function(source, args, rawCommand)
if canRelog == true then
if canRelog then
canRelog = false
TriggerServerEvent('esx_multicharacter:relog')
ESX.SetTimeout(10000, function()
+1 -1
View File
@@ -1,6 +1,6 @@
if not ESX then
error('\n^1Unable to start Multicharacter - you must be using ESX Legacy^0')
elseif ESX.GetConfig().Multichar == true then
elseif ESX.GetConfig().Multichar then
local DATABASE do
local connectionString = GetConvar('mysql_connection_string', '');
if connectionString == '' then