[BSG] Bright_Hawk [TSN]posted
Does this mod work side by side with VC/ELS mod? Or does it replace it?
Does this mod work side by side with VC/ELS mod? Or does it replace it?
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:
get)VehicleData.Members.MaxHealth).RCD.VehiclesList[class].Members.MaxHealth or ent.MaxHealth.2000.set)SetCurHealth(health) and SetNWInt("Health", health) so HUD stays consistent.Result after fix:
Remaining improvements suggested:
list.Get("simfphys_vehicles") registry to always resolve Members.MaxHealth reliably.RCD:OnSpawnVehicleBought hook, so it always applies after RCDSetVehicleParams overrides.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
},
}
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:
In both cases, the vehicle always spawns broken and needs to be repaired manually.
Could this be looked into or fixed?
Thanks in advance!
Hello
Yes you can do it you need to left click on the NPC with the tool of the product.
Hello
I already added Glide vehicle support, sorry for the time of my answe .
Is there a build in garage system wherei can only take out purchased car
Bonjour. C'est la même chose pour moi, quand penses-tu que les Glide GTAV Helicopters seront ajoutés ? Merci
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 :)
Is the script compatible with LVS cars?
Hello, is it possible to add LVS vehicles to the dealer?
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 !
any way to make a showcase room with this addon ?
Would be so cool if it would be compatibel with WAC...
Does this dealer work with LVS Star Wars?
https://steamcommunity.com/sharedfiles/filedetails/?id=2919757295
Hi, it's compatible with https://steamcommunity.com/sharedfiles/filedetails/?id=3027255911 ?
Engine, Repair, Speedometer ?...
bonjour es que je pourait s'avoir comment give un véhicule pour le pcasino
Is it definitely compatible with LVS?
https://steamcommunity.com/sharedfiles/filedetails/?id=2912826012
Pls add a Car Tunner they can Repair the car and triune the car.
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 ?
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