altmp / altv-types

Type definitions for the alt:V JavaScript modules.
https://www.npmjs.com/~vadzz
MIT License
29 stars 73 forks source link

server: reverse event arguments for vehicle attachment #253

Closed sudojunior closed 12 months ago

sudojunior commented 1 year ago

Found event arguments were flipped when trying to use the events for https://github.com/sudojunior/altv-os-indicators/pull/5, unsure if the parent vehicle should remain the leading argument.

C0kkie commented 1 year ago

Are you sure? Cuz in the code its how it is in the typings currently

sudojunior commented 1 year ago

My referenced code targeted the truck when it was the leading argument, which disabled it's indicators when vehicleDetach was run.

alt.on('vehicleAttach', (vehicle1, vehicle2) => {
  console.log(vehicle1.id, "->", vehicle2.id); // 2 -> 1
});

And despite trailer being the second vehicle entity of the session, it is vehicle1 - so which one leads? image

... or would it be better to just add a note to the event?