Open ArranTuna opened 6 years ago
What is the mantis report for this?
@sbx320 said:
Seems to be a GTA mechanic. Bikes don't seem to get damaged in a crash when the driver falls off.
In light of the above comment by sbx, what are your plans for this @patrikjuvonen?
First I'm going to test around and see what can be done. If bikes really do get absolutely no damage when ped is falling off then there's also no reason to call the event.
For whatever reason I am not able to reproduce this problem in Multi Theft Auto v1.5.6-release-16191 or then I'm doing it wrong. I spawned a NRG-500 (also tried a few other motorcycles and bicycles), hit the wall a couple times, then smashed right into a wall and fell off (after having used setPedCanBeKnockedOffBike on myself), and it does show the loss, although it seems it's a tiny bit late maybe...?
For whatever reason I am not able to reproduce this problem in Multi Theft Auto v1.5.6-release-16191 or then I'm doing it wrong. I spawned a NRG-500 (also tried a few other motorcycles and bicycles), hit the wall a couple times, then smashed right into a wall and fell off (after having used setPedCanBeKnockedOffBike on myself), and it does show the loss, although it seems it's a tiny bit late maybe...?
It's possible that this damage is a result of the bike bouncing/scratching on the ground after you already fell off. If the impact is sufficient, it can go 'lead its own life' and get additional damage that is separated from the main impact damage which may not register. I recommend you to try multiple times, I will also try to reproduce it and update my reply.
Note: when working on this issue, it's a good idea to take into account this related issue (not transferred): Bike crashes cannot inflict fatal HP damage to players - if it's a GTA mechanic, it may aswell be the same sort of.
Describe the bug onVehicleDamage doesn't trigger for crashes that knock the player off a bike
To Reproduce Steps to reproduce the behavior:
srun addEventHandler("onVehicleDamage", getRootElement(), function(loss) outputChatBox(loss) end)
Expected behavior The event should trigger.
Additional context From https://bugs.mtasa.com/view.php?id=7679