From 827f2453b5c318657c26a58752f07b8949d7fa4b Mon Sep 17 00:00:00 2001 From: Linden Date: Fri, 21 May 2021 07:14:12 +1000 Subject: [PATCH] refactor(command): Remove unneeded variable --- client/functions.lua | 8 ++++---- server/commands.lua | 5 +---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index 4410ba43..0fe22b66 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -324,7 +324,7 @@ ESX.Game.Teleport = function(entity, coords, cb) if DoesEntityExist(entity) then RequestCollisionAtCoord(vector.xyz) while not HasCollisionLoadedAroundEntity(entity) do - Wait(0) + Citizen.Wait(0) end SetEntityCoords(entity, vector.xyz, false, false, false, false) @@ -342,7 +342,7 @@ ESX.Game.SpawnObject = function(object, coords, cb, networked, dynamic) networked = networked == nil and true or false dynamic = dynamic ~= nil and true or false - CreateThread(function() + Citizen.CreateThread(function() ESX.Streaming.RequestModel(model) -- The below has to be done just for CreateObject since for some reason CreateObjects model argument is set @@ -374,7 +374,7 @@ ESX.Game.SpawnVehicle = function(vehicle, coords, heading, cb, networked) local model = (type(vehicle) == 'number' and vehicle or GetHashKey(vehicle)) local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z) networked = networked == nil and true or false - CreateThread(function() + Citizen.CreateThread(function() ESX.Streaming.RequestModel(model) local vehicle = CreateVehicle(model, vector.xyz, heading, networked, false) @@ -391,7 +391,7 @@ ESX.Game.SpawnVehicle = function(vehicle, coords, heading, cb, networked) RequestCollisionAtCoord(vector.xyz) while not HasCollisionLoadedAroundEntity(vehicle) do - Wait(0) + Citizen.Wait(0) end if cb then diff --git a/server/commands.lua b/server/commands.lua index b3adaa9f..56874a37 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -1,4 +1,3 @@ -local crash = false ESX.RegisterCommand('setcoords', 'admin', function(xPlayer, args, showError) xPlayer.setCoords({x = args.x, y = args.y, z = args.z}) end, false, {help = _U('command_setcoords'), validate = true, arguments = { @@ -169,9 +168,7 @@ ESX.RegisterCommand('sv_restart', "admin", function(xPlayer, args, showError) DropPlayer(playerId, "Server Restart") end print('^2[INFO] ^1 Server Restarting, Please Wait :)') - crash = true - while crash do - end + while true do end end) end, true)