From 7ac0fe41b2ae6f7ff9a007f6cfdbcd73469bf892 Mon Sep 17 00:00:00 2001 From: renzuzu <82306584+renzuzu@users.noreply.github.com> Date: Sat, 9 Oct 2021 19:41:58 +0800 Subject: [PATCH] fix(client): loading status https://github.com/renzuzu/renzu_hud/issues/27 --- renzu_hud/client/client.lua | 5 +++-- renzu_hud/client/function.lua | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/renzu_hud/client/client.lua b/renzu_hud/client/client.lua index 4e5c2979..356780b8 100644 --- a/renzu_hud/client/client.lua +++ b/renzu_hud/client/client.lua @@ -332,6 +332,7 @@ CreateThread(function() if config.registerautostatus and not registered then DecorRegister("STATUSR", 1) + print("REGISTER START") for k,v in pairs(config.statusordering) do -- register all status if v.enable and v.custom and register[v.status] == nil and not DecorGetBool(PlayerPedId(), "STATUSR") then local remove_value = v.statusremove @@ -506,7 +507,7 @@ CreateThread(function() SendNUIMessage({type = "SetStatusOrder",content = {['table'] = config.statusordering, ['float'] = config.statusplace}}) Wait(1000) Hud.reorder = true - while not Hud.playerloaded do Citizen.Wait(100) end + while not Hud.playerloaded do Citizen.Wait(100) print("loading") end Wait(100) local tbl = {['table'] = config.statusordering, ['float'] = config.statusplace} if config.enable_carui then @@ -545,7 +546,7 @@ CreateThread(function() Hud:EnterVehicleEvent(true,Hud.vehicle) end --WHEN RESTARTED IN CAR - while Hud.veh_stats == nil do + while not LocalPlayer.state.loaded do --print("vehstats") Wait(100) end diff --git a/renzu_hud/client/function.lua b/renzu_hud/client/function.lua index a14da5e6..d6553e5d 100644 --- a/renzu_hud/client/function.lua +++ b/renzu_hud/client/function.lua @@ -185,7 +185,6 @@ function Hud:EnterVehicleEvent(state,vehicle) if config.enable_carui_perclass then self:DefineCarUI(config.carui_perclass[GetVehicleClass(vehicle)]) end - --print("veh loop") -- self.plate = tostring(GetVehicleNumberPlateText(vehicle)) -- self.plate = string.gsub(self.plate, '^%s*(.-)%s*$', '%1') self.hp = GetVehicleEngineHealth(vehicle)