mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

getVehicleType does not work on vehicles made using engineRequestModel

Open SDabdlmounaim96 opened this issue 5 years ago • 8 comments

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 banshee

image 2 : showing it return EMPTY "" when trying with added vehicle (not replaced) via #2166 s15

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

SDabdlmounaim96 avatar Mar 31 '21 14:03 SDabdlmounaim96

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.

fresholia avatar Mar 31 '21 16:03 fresholia

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.

Pirulax avatar Mar 31 '21 22:03 Pirulax

Connected with https://github.com/multitheftauto/mtasa-blue/issues/1849

Allerek avatar Apr 03 '21 23:04 Allerek

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.

Fernando-A-Rocha avatar Oct 20 '21 18:10 Fernando-A-Rocha

That's what I did, and it is working for me on the latest nightly using the test resource from my PR: image

BCG2000 avatar Oct 20 '21 21:10 BCG2000

@Fernando-A-Rocha, I see now... I missed the OOP way of doing it: image 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.

BCG2000 avatar Oct 21 '21 03:10 BCG2000

@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: image So the only thing left to fix are all those other bugs, this issue here is really fully fixed.

BCG2000 avatar Oct 21 '21 11:10 BCG2000

Alright, thank you! The visual bugs remain then #2277

Fernando-A-Rocha avatar Oct 21 '21 13:10 Fernando-A-Rocha