Best way to detect driver drive by on another vehicle -
Redirect Left - 11.02.2016
Hello.
What's the best way of detecting if a the driver of a vehicle hit another (occupied) vehicle using drive by? I was going to use OnPlayerWeaponShot or GetPlayerLastShotVectors, but they both still doesn't work with driver driveby.
So what is the most efficient and reliable method of detecting when this occurs? I'm not interested in the amount of damage caused, just that X hit Ys vehicle using drive by.
Cheers for any help/advice.
Re: Best way to detect driver drive by on another vehicle -
ball - 11.02.2016
Maybe callback OnVehicleDamageStatusUpdate is called when player shoot - then you check drive by there.
Re: Best way to detect driver drive by on another vehicle -
Redirect Left - 11.02.2016
Quote:
Originally Posted by ball
Maybe callback OnVehicleDamageStatusUpdate is called when player shoot - then you check drive by there.
|
That only detects when a specific area of the car is damaged, such as a headlight being knocked out or a door panel being damaged. Weapon shot doesn't cause that damage (see:
https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate)
Only thing it'd detect is tyres being popped, and a driver db doing that is entirely by chance really.
Re: Best way to detect driver drive by on another vehicle -
itsCody - 11.02.2016
Detect when the weapon is shot while inside the car and detect the hit type, and if its occupied?
Re: Best way to detect driver drive by on another vehicle -
Redirect Left - 11.02.2016
Quote:
Originally Posted by itsCody
Detect when the weapon is shot while inside the car and detect the hit type, and if its occupied?
|
How would I do that? As I described in first post, OnPlayerWeaponShot doesn't work on driver drive by, and 'hit type' isn't relayed by any other function, so i don't know what you mean by that?
Re: Best way to detect driver drive by on another vehicle -
Kar - 11.02.2016
Keys.. Q and E with KEY_FIRE should work in OPU. But you won't get every shot detected I bet with UZI/Tec9. Draw a line segment to the direction facing (Q or E) and check for a vehicle (GetVehicleModelInfo) and test for health going down...
Lol and that's the workaround since there aren't really any native functions for this.
I wish They could add OnPlayerWeaponShot for drive bys though.. annoying AF. Want a suggestion Mods? Release 0.3.8 with all the things sa-mp is currently missing from it's existing features!...
Re: Best way to detect driver drive by on another vehicle -
Redirect Left - 12.02.2016
Quote:
Originally Posted by Kar
Want a suggestion Mods? Release 0.3.8 with all the things sa-mp is currently missing from it's existing features!...
|
Yeah. The only way i'd ass myself into doing that is if there was ever a chance of it being incorporated into default SA:MP, else its a waste of time and it'd constantly require updating and eventually fall out of favour with all of its bonuses forgotten (look at SA:MP+ mod from a while ago).
Thanks for your suggestion though, seems best option right now, cheers i'll try that.