multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.42k stars 438 forks source link

Peds can't be knocked off damage proof bikes #1681

Open adlude opened 4 years ago

adlude commented 4 years ago

Describe the bug setVehicleDamageProof(vehicle, true) results in an inability to fall off a bike despite setPedCanBeKnockedOffBike setting.

To reproduce

1.) Use setPedCanBeKnockedOffBike(ped, true). 2.) Create a server-side vehicle, set it damage proof and warp the local ped into it. 3.) Observe the ped with an inability to be knocked off of the bike.

A resource from which this can be reproduced is below. Use /dmgproof to toggle bike invulnerability to help observe the bug.

biketest.zip

Expected behaviour I believe a ped should be able to fall off of a bike when the vehicle is damage proof and setPedCanBeKnockedOffBike is enabled.

Version 1.5.7-release-20632

AlexTMjugador commented 4 years ago

Maybe that function tells GTA to skip all collision damage related code for vehicles, including the one that initiates the action of falling off a bike. What happens if you cancel the onClientVehicleDamage event instead?

Lordmau5 commented 1 month ago

I've run into this same issue yesterday and after some troubleshooting figured out it's because of that method.

Using onClientVehicleDamage as you suggested does indeed allow the player to fall off their bike again.

This might be worth adding to the wiki for both the function and maybe also the event

Lordmau5 commented 1 month ago

I just went ahead and added some notes to the setPedCanBeKnockedOffBike and setVehicleDamageProof functions on the wiki https://wiki.multitheftauto.com/wiki/SetPedCanBeKnockedOffBike https://wiki.multitheftauto.com/wiki/SetVehicleDamageProof