Skip to content

Commit

Permalink
fix(client): car status update in vehicle
Browse files Browse the repository at this point in the history
  • Loading branch information
renzuzu committed Oct 25, 2021
1 parent efe38ac commit 1c20611
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions renzu_hud/client/function.lua
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ function Hud:get_veh_stats(v,p)
end
local lets_save = false
if self.plate ~= nil and self.veh_stats[self.plate] == nil then
--print("CREATING VEHSTATS")
print("CREATING VEHSTATS")
lets_save = true
self.veh_stats[self.plate] = {}
self.veh_stats[self.plate].plate = self.plate
Expand Down Expand Up @@ -909,7 +909,7 @@ function Hud:NuiMileAge()
local driver = GetPedInVehicleSeat(self.vehicle , -1)
if self.vehicle ~= nil and self.vehicle ~= 0 and driver == self.ped then
-- local self.plate = tostring(GetVehicleNumberPlateText(self.vehicle ))
-- self.plate = string.gsub(self.plate, '^%s*(.-)%s*$', '%1')
--self.plate = string.gsub(self.plate, '^%s*(.-)%s*$', '%1')
local newPos = GetEntityCoords(self.ped)
savemile = true
lastve = GetVehiclePedIsIn(self.ped, false)
Expand Down Expand Up @@ -984,7 +984,6 @@ function Hud:NuiMileAge()
end
if newmileage ~= nil and newmileage+0.5 < Round(self.veh_stats[self.plate].mileage) or newmileage == nil then
newmileage = self.veh_stats[self.plate].mileage
print(newmileage)
SendNUIMessage({
type = "setMileage",
content = self.veh_stats[self.plate].mileage
Expand Down Expand Up @@ -2624,7 +2623,6 @@ function Hud:bodydamage()
if config.disabledregen then
SetPlayerHealthRechargeMultiplier(self.pid, 0.0)
end
print(health)
if health ~= nil and health > 55.0 then
SetEntityHealth(PlayerPedId(),(GetEntityHealth(self.ped)) - config.chesteffect_healthdegrade)
end
Expand Down Expand Up @@ -3505,9 +3503,11 @@ function Hud:CarStatus()
self.vehicle = self:getveh()
local dis = #(GetEntityCoords(self.ped) - GetEntityCoords(self.vehicle ))
if dis > 10 then return end
self.plate = tostring(GetVehicleNumberPlateText(self.vehicle ))
--self.plate = tostring(GetVehicleNumberPlateText(self.vehicle ))
--self.plate = string.gsub(self.plate, '^%s*(.-)%s*$', '%1')
self:get_veh_stats(self.vehicle , self.plate)
if self.veh_stats[self.plate] == nil then
self:get_veh_stats(self.vehicle , self.plate)
end
self.carstatus = not self.carstatus
local turbolevel = self.veh_stats[self.plate].turbo
if turbolevel == 'default' then
Expand Down

0 comments on commit 1c20611

Please sign in to comment.