Skip to content

Commit

Permalink
Merge pull request #78 from Gellipapa/main
Browse files Browse the repository at this point in the history
Fix some hud issues
  • Loading branch information
Gellipapa authored Dec 16, 2023
2 parents 4411900 + 0b6f363 commit 68fa08d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 7 additions & 2 deletions client/player/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ function HUD:SlowThick()
self.Data.Weapon.Image = string.gsub(WeaponList[self.Data.Weapon.CurrentWeapon].name, "WEAPON_", "")
self.Data.Weapon.Image = string.lower(self.Data.Weapon.Image)
end

--here we handle it when we find a hash that is not in the weapon list so we don't show the weapon data on the hud
if self.Data.Weapon.Active then
self.Data.Weapon.Active = self.Data.Weapon.CurrentWeapon ~= 0 and self.Data.Weapon.Name and self.Data.Weapon.Image
end
end

Wait(1000)
Expand Down Expand Up @@ -93,8 +98,8 @@ function HUD:FastThick()
moneys = { bank = self.Data.Money.bank or 0, money = self.Data.Money.cash or 0 },
weaponData = {
use = self.Data.Weapon.Active,
image = self.Data.Weapon.Image or "pistol",
name = self.Data.Weapon.Name or "Pistol",
image = self.Data.Weapon.Image or false,
name = self.Data.Weapon.Name or false,
isWeaponMelee = self.Data.Weapon.isWeaponMelee,
currentAmmo = self.Data.Weapon.CurrentAmmo or 0,
maxAmmo = self.Data.Weapon.MaxAmmo or 0,
Expand Down
10 changes: 7 additions & 3 deletions client/vehicle/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ if not Config.Disable.Vehicle then
HUD.Data.Driver = driverCheck(currentVehicle)
playerPos = GetEntityCoords(PlayerPedId()).xy

if not Config.Default.PassengerSpeedo and not HUD.Data.Driver then
SendNUIMessage({ type = "VEH_HUD", value = { show = false } })
isPassenger = true
if not Config.Default.PassengerSpeedo then
if HUD.Data.Driver then
isPassenger = false
else
SendNUIMessage({ type = "VEH_HUD", value = { show = false } })
isPassenger = true
end
end
Wait(1000)
end
Expand Down

0 comments on commit 68fa08d

Please sign in to comment.