BeamMP-Server icon indicating copy to clipboard operation
BeamMP-Server copied to clipboard

[Feature Request] `onVehicleSwitched(pid, from, to)` API Event

Open daniel-w0 opened this issue 2 years ago • 3 comments

Describe the solution you'd like When a user switches vehicle in-game, the server should call an event called onVehicleSwitched with the following arguments: (pid, from, to).

daniel-w0 avatar May 28 '23 15:05 daniel-w0

The packet is the Om packet. Om:SpectatorID:SpectatedID-SpectatedVehicleID eg. Om:0:1-0

However what beammp does not do and i would consider this a bug, is that if someone who is watching another car, is spawning a vehicle no longer spectates the other car but now his own, but beammp doesnt update that to the other players.

OfficialLambdax avatar May 28 '23 16:05 OfficialLambdax

This is interesting and a feature that I too think would be helpful!

@OfficialLambdax would you mind putting the second part of your comment into a new issue as a bug report as this is something else that should be looked into.

Starystars67 avatar Jun 01 '23 12:06 Starystars67

The interesting part about this is also that you can use this for commands. I use that already in the bot. Heres a example

/kick !them !them is translated to the vehicle owner that is spectated by the Player who send this command. This is only possible when the server script can know who is spectating who

OfficialLambdax avatar Jun 01 '23 15:06 OfficialLambdax