Hi is it possible to get the update that a model was release with?
Mainly to sort through GetAllVehicleModels() and put them in order of release, like the website in the main game.
If not, is there another way to achieve this?
Thanks.
As far as I know, there is not really any way to get what dlc a vehicle is a part of using natives. The website in regular gta/gta online probably draws its vehicles from a handmade list.
But you might still be interested in the following natives:
GetDlcVehicleData, GetDlcVehicleFlags, GetDlcVehicleModLockHash, GetDlcVehicleModel, GetNumDlcVehicles and IsDlcVehicleMod.
If none of those will help you at all, you could always “just” manually look through GTA fandom as it does have an updated list of all GTA 5 updates/dlc’s and the vehicles that came along with them.
I hope that I provided something that helped you!
Thank you dude, I appreciate you taking the time out to answer. I will give them a go in a little while and report back.
Ok so finally sat down and gave it a go. I did manage to do what I wanted using
GetNumDlcVehicles() and GetDlcVehicleModel(num),
although not perfect, looping through all of the DLC models and comparing them to GetAllVehicleModels() seemed to kinda achieve what I wanted, although towards the far end of the list of DLC there are a few vehicles that are a lot older, and thus not in order. There is no gaps so I guess rockstar must bump these vehicles up to the end of the list whenever there are new vehicles added, but I dont know.
Oh well, there are many ways to resolve the vehicles at the end of the list. I’m just happy that I can put the vehicles in a near-perfect order from their day of release.
Here’s a snippet from my code that gets all of the vehicle info, if anyone wants to reference it in the future:
function allModels()
if #all.models > 0 then all.models = {} end
local tab = GetAllVehicleModels()
if tab ~= nil then
for a, ta in pairs(tab) do
local inf = {mu = table.copy(men.types.null)}
inf.name = ta
inf.id = GetDisplayNameFromVehicleModel(ta)
inf.desc = GetMakeNameFromVehicleModel(ta).." "..inf.id
inf.seats = GetVehicleModelNumberOfSeats(ta)
inf.acc = GetVehicleModelAcceleration(ta)
inf.Agi = GetVehicleModelEstimatedAgility(ta)
inf.mx = GetVehicleModelEstimatedMaxSpeed(ta)
inf.brak = GetVehicleModelMaxBraking(ta)
inf.brakmod = GetVehicleModelMaxBrakingMaxMods(ta)
inf.knots = GetVehicleModelMaxKnots(ta)
inf.trac = GetVehicleModelMaxTraction(ta)
inf.resi = GetVehicleModelMoveResistance(ta)
inf.cash = GetVehicleModelValue(ta)
if IsThisModelABicycle(ta) then inf.typ = "Bicycle"
elseif IsThisModelABike(ta) then inf.typ = "Bike"
elseif IsThisModelABoat(ta) then inf.typ = "Boat"
elseif IsThisModelACar(ta) then inf.typ = "Car"
elseif IsThisModelAJetski(ta) then inf.typ = "JetSki"
elseif IsThisModelAPlane(ta) then inf.typ = "Plane"
elseif IsThisModelAQuadbike(ta) then inf.typ = "Quad"
elseif IsThisModelATrain(ta) then inf.typ = "Train"
elseif IsThisModelAnAmphibiousCar(ta) then inf.typ = "Amphibious"
else inf.typ = "Helicopter" --I think, untested.
end
local dlc = GetNumDlcVehicles()
local vname = GetDisplayNameFromVehicleModel(inf.name)
local found = false
for i = 1, dlc do
local dmo = GetDlcVehicleModel(i)
local dname = GetDisplayNameFromVehicleModel(dmo)
if vname == dname then
inf.dlc = i
found = true
end
end
if found == false then inf.dlc = -1 end
table.insert(all.models, inf)
end
return true
end
end
Heres what the list looks like:
The last 13 vehicles are from older DLC’s, but after that they are in order from release.
It wont be hard to sort the table so that they last 13 entries get moved to before the first update or something.
(PS: Ignore the state of my menu, its far from finished haha)