BeamMP / BeamMP-Server

Server for the multiplayer mod BeamMP for BeamNG.drive
https://beammp.com
GNU Affero General Public License v3.0
117 stars 52 forks source link

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

Open vulcan-dev opened 1 year ago

vulcan-dev commented 1 year ago

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).

OfficialLambdax commented 1 year ago

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.

Starystars67 commented 1 year ago

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.

OfficialLambdax commented 1 year ago

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