PivityGmodStore

🚗 Realistic Car Dealer - Take your car with style

(36)(403)

You can always read the reviews or discuss this product

[BSG] Bright_Hawk [TSN]posted

Does this mod work side by side with VC/ELS mod? Or does it replace it?

DahakaPurchasedposted

Bug Report – Realistic Car Dealer with Simfphys Vehicles

Issue observed:

When spawning Simfphys vehicles through the Realistic Car Dealer, cars often spawn damaged, usually with 100 HP (or other incorrect values), even if the vehicle has never taken damage.

Spawning the same vehicle manually (outside the dealer) works fine – the car spawns with its correct MaxHealth (e.g. 4500 HP).


Root cause:

The problem is inside the compatibility system:


lua/realistic_cardealer/sh_advanced_config.lua  

→ RCD.CompatibilitiesOptions["saveHealth"]


The original code uses 100 as a fallback value when it cannot read the vehicle’s health.

This fallback is then written back into the vehicle with SetCurHealth(100), which causes all Simfphys cars to spawn broken.

For Simfphys specifically, calling ent:GetCurHealth() during initialization often returns incomplete values (e.g. 2000/4500), since the vehicle hasn’t finished loading its full VehicleData yet.

Also, the Simfphys HUD reads HP from NWInt("Health"), but the dealer was not updating this networked value, so HUD and server health were out of sync.


ix applied (provisional):

We modified the saveHealth compatibility logic:

  1. Getter (get)
  2. First tries to read the current health.
  3. If invalid, falls back to the real MaxHealth (VehicleData.Members.MaxHealth).
  4. If still not found, tries RCD.VehiclesList[class].Members.MaxHealth or ent.MaxHealth.
  5. Final fallback: 2000.
  6. Always clamps to ≥ 1000.
  7. Setter (set)
  8. Guarantees health never goes below 1000.
  9. For Simfphys: applies both SetCurHealth(health) and SetNWInt("Health", health) so HUD stays consistent.
  10. For SVMOD/VCMod: keeps the original logic.

Result after fix:

  1. Simfphys cars no longer spawn broken when purchased from the dealer.
  2. They correctly spawn with their full MaxHealth (e.g. 4500 HP).
  3. HUD and server health values are now synchronized.


Remaining improvements suggested:

  1. Use the official list.Get("simfphys_vehicles") registry to always resolve Members.MaxHealth reliably.
  2. Consider moving the correction to the RCD:OnSpawnVehicleBought hook, so it always applies after RCDSetVehicleParams overrides.
  3. Add a configurable cvar (e.g. rcd_min_simfphys_hp) to define a minimum HP for spawned vehicles.


📌 Summary:

The issue happens because saveHealth falls back to 100, which is then reapplied to vehicles.

With the changes above, the dealer now respects the real MaxHealth of Simfphys vehicles, preventing them from spawning broken.



FULL PATCH:


--[[ All compatibilities options ]]

RCD.CompatibilitiesOptions = { 

  ["saveHealth"] = {

    ["type"] = "number",

    ["get"] = function(ent, vehicleId)

      local health


      if not IsValid(ent) then return 1000 end -- fallback seguro


      if not ent.IsSimfphyscar then

        if SVMOD and SVMOD:IsVehicle(ent) then

          health = ent:SV_GetHealth()

        elseif VC && isfunction(ent.VC_getHealth) then

          health = ent:VC_getHealth(true)

        end

      else

        health = ent:GetCurHealth()

      end


      -- Se não conseguiu pegar vida, tenta usar o MaxHealth verdadeiro

      if not health or health <= 0 then

        if ent.VehicleData and ent.VehicleData.Members and ent.VehicleData.Members.MaxHealth then

          health = ent.VehicleData.Members.MaxHealth

        elseif RCD.VehiclesList 

          and RCD.VehiclesList[ent.VehicleName or ent:GetClass()] 

          and RCD.VehiclesList[ent.VehicleName or ent:GetClass()].Members 

          and RCD.VehiclesList[ent.VehicleName or ent:GetClass()].Members.MaxHealth then

          health = RCD.VehiclesList[ent.VehicleName or ent:GetClass()].Members.MaxHealth

        elseif ent.MaxHealth and ent.MaxHealth > 0 then

          health = ent.MaxHealth

        else

          health = 2000 -- fallback padrão

        end

      end


      if health < 1000 then health = 1000 end

      return health

    end,


    ["set"] = function(ent, value, vehicleId)

      local noLoadHealth = RCD.GetSetting("noLoadHealth", "boolean")

      if noLoadHealth then return end


      local health = tonumber(value) or 1000

      if not IsValid(ent) then return health end


      if not isnumber(health) or health <= 10 then 

        health = 1000 

      end


      if not ent.IsSimfphyscar then

        if SVMOD and SVMOD:IsVehicle(ent) then

          ent:SV_SetHealth(health)

        elseif VC && isfunction(ent.VC_getHealthMax) then

          local maxHealth = (ent:VC_getHealthMax() or health)

          ent:VC_setHealth(maxHealth * ((health or 100) / 100))

        end

      else

        -- Simfphys: aplica vida correta e sincroniza HUD

        ent:SetCurHealth(health)

        ent:SetNWInt("Health", health)

      end


      return health

    end,


    ["checkCompatibility"] = function()

      return true

    end

  },


  ["saveFuel"] = {

    ["type"] = "number",

    ["get"] = function(ent, vehicleId)

      local fuel = 100

      if not IsValid(ent) then return fuel end


      if not ent.IsSimfphyscar then

        if SVMOD and SVMOD:IsVehicle(ent) then

          fuel = ent:SV_GetFuel()

        elseif VC && isfunction(ent.VC_getHealth) then

          fuel = ent:VC_fuelGet()

        end

      else

        fuel = ent:GetFuel() 

      end


      return fuel

    end,

    ["set"] = function(ent, value, vehicleId)

      local noLoadFuel = RCD.GetSetting("noLoadFuel", "boolean")

      if noLoadFuel then return end


      local fuel = (tonumber(value) or 100)

      if not IsValid(ent) then return fuel end


      if not ent.IsSimfphyscar then

        if SVMOD and SVMOD:IsVehicle(ent) then

          ent:SV_SetFuel(fuel)

        elseif VC && isfunction(ent.VC_fuelSet) then

          ent:VC_fuelSet(fuel)

        end

      else

        ent:SetFuel(fuel)

      end

    end,

    ["checkCompatibility"] = function()

      return true

    end

  },


  ["insuranceWaitingTime"] = {

    ["type"] = "number",

    ["get"] = function(ent, vehicleId)

      return (ent.RCDWaitingTime or 0)

    end,

    ["set"] = function(ent, value, vehicleId) end,

    ["checkCompatibility"] = function()

      return true

    end

  },


  ["saveLicensePlateRPT"] = {

    ["type"] = "string",

    ["get"] = function(ent, vehicleId, oldCompatibilitieValues)

      return (oldCompatibilitieValues["saveLicensePlateRPT"] or Realistic_Police.GeneratePlateValues())

    end,

    ["set"] = function(ent, value, vehicleId)

      Realistic_Police.SetInfoVehc(ent, value)

    end,

    ["checkCompatibility"] = function()

      return istable(Realistic_Police) && isfunction(Realistic_Police.GeneratePlateValues)

    end

  },

}

DahakaPurchasedposted

Hello, I’m having an issue with the addon regarding Simfphys vehicles.

Whenever I spawn a car through the dealer, it always appears fully damaged with 0 health, even if the vehicle was never damaged before.

This happens consistently:

  1. When spawning a new car from the dealer.
  2. When storing a car and then immediately spawning it again.

In both cases, the vehicle always spawns broken and needs to be repaired manually.

Could this be looked into or fixed?

Thanks in advance!

KobralostAuthorModeratorposted

Hello Pablo

Yes you can do it you need to left click on the NPC with the tool of the product.

Hello Reacker Smith& Series Playboy

I already added Glide vehicle support, sorry for the time of my answe .

PabloPurchasedposted

Is there a build in garage system wherei can only take out purchased car

Reacker SmithPurchasedposted edited

Bonjour. C'est la même chose pour moi, quand penses-tu que les Glide GTAV Helicopters seront ajoutés ? Merci

Series PlayboyPurchasedposted edited

Hi there

So i saw that you added Glide vehicles but i can only seem to add the main vehicles (planes, boats, bikes, cars and the truck & trailer) from Glide but not add Glide GTAV Helicopters or Glide AW-119 Kiowa


Cant wait to hear back on how to add them to the dealers :)

KobralostAuthorModeratorposted

Hello Uesto

Sorry for the time of my answer. Yes it's compatible with all cars.

Uestoposted

Is the script compatible with LVS cars?

KobralostAuthorModeratorposted

Hello Paulus,

Sorry for the delay, this addon should be compatible with Wac.

Hello Zen,

It's compatible with LVS.

Zenposted

Hello, is it possible to add LVS vehicles to the dealer?

[BØO] E U P H Ø R I Aposted

impossible de trouver le "vehicleID", quelqu'un pourrait m'aider svp ? j'aimerai le faire fonctionner avec Tip4Serv mais j'ai besoin du VehicleID :p

Merci !

✘Hack✘Purchasedposted

any way to make a showcase room with this addon ?

Paulusposted

Would be so cool if it would be compatibel with WAC...

JeanFlismonzeguePurchasedposted

bonjour es que je pourait s'avoir comment give un véhicule pour le pcasino

TheStarHDPurchasedposted

Pls add a Car Tunner they can Repair the car and triune the car.

Janus | Vietnam RPposted

Salut l'ami, avec les véhicules symphis, quand je spawn une voiture elle passe de 750hp à 100 directement et je ne trouve pas la source du problème, un de tes clients à déjà eu ce soucis ?

☆BLOOSTER☆posted

Y'a t'il un un systeme avec la jauge d'essence et la vie du vehicule ?

Ou il compatible avec un autre addon comme SVMod ?

Merci

KobralostAuthorModeratorposted

Hello MeOxiis try to reconfigure plate and cardealer if the problem persist please open a ticket.

KobralostAuthorModeratorposted

Hello Skip this addon is entire compatible with simfphys

Showing 24 of 62 total results