getVehicleType does not work on vehicles made using engineRequestModel
Describe the bug
i suspect this bug is related to my previous issue #2166
but to describe it simply,
vehicles made using newly generated ids by engineRequestModel don't return the proper vehicle type
Expected behaviour it should return for example "Automobile" or returns the type of it's inherited / cloned vehicle id
Screenshots
image 1 : showing the banshee working just fine
image 2 : showing it return EMPTY "" when trying with added vehicle (not replaced) via #2166
Code i used to check the values addEventHandler("onClientVehicleStartEnter", root, function( p ) iprint( "Vehicle Type "..source.vehicleType ) end)
Version Please provide the following information:
- server/client version v1.5.8-release-20839
Since the ID returned with the engineRequestModel has not been included in the vehicle list before, it must be determined by the client. The main problem here is that this function is not working.
setVehicleType can be added for engineRequestModel cars.
engineRequestModel isn't completely done yet at this point.
The implementation is there, but we must add support for it on the server side as well, and nobody is sure what the best approach is.
Connected with https://github.com/multitheftauto/mtasa-blue/issues/1849
Still doesn't work clientside, getVehicleType returns nil for a vehicle with a new ID after this PR @Pirulax @BCG2000
There are of course temporary solutions such as redefining getVehicleType function to use the vehicle's base/parent model ID.
That's what I did, and it is working for me on the latest nightly using the test resource from my PR:

@Fernando-A-Rocha, I see now... I missed the OOP way of doing it:
Since it is not critical, it would better to fix it together with other issues if possible rather than doing another small PR just for this. But for now, you can do it through the procedural way.
Edit: Well, what I thought was the culprit at first was not it... So gotta investigate more.
@Fernando-A-Rocha, ignore what I said above, I derped... My bad. OOP version is working correctly too, I accidentally misnamed a variable when testing it and that's why it appeared as nil before:
So the only thing left to fix are all those other bugs, this issue here is really fully fixed.
Alright, thank you! The visual bugs remain then #2277