Merge pull request #920 from LoxGame/moskalyka/more-logical-code

refactor: more logical code
This commit is contained in:
TheFantomas
2023-03-01 11:29:04 +01:00
committed by GitHub
6 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -357,7 +357,7 @@ function ESX.Game.Teleport(entity, coords, cb)
end
function ESX.Game.SpawnObject(object, coords, cb, networked)
networked = networked == nil and true or networked
networked = networked or true
if networked then
ESX.TriggerServerCallback('esx:Onesync:SpawnObject', function(NetworkID)
if cb then
@@ -405,7 +405,7 @@ end
function ESX.Game.SpawnVehicle(vehicle, coords, heading, cb, networked)
local model = type(vehicle) == 'number' and vehicle or joaat(vehicle)
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
networked = networked == nil and true or networked
networked = networked or true
CreateThread(function()
ESX.Streaming.RequestModel(model)
+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
@@ -13,7 +13,7 @@ function Post(fn,...)
end
function Open(position,eles,onSelect,onClose,canClose)
local canClose = canClose == nil and true or canClose
local canClose = canClose or true
activeMenu = {
position = position,
eles = eles,
+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