diff --git a/client/js/compatibility/events/player.js b/client/js/compatibility/events/player.js index e28372b5..c7128691 100644 --- a/client/js/compatibility/events/player.js +++ b/client/js/compatibility/events/player.js @@ -43,3 +43,7 @@ registerEventHandler(alt.Enums.EventType.PLAYER_STOP_TALKING, "playerStopTalking registerEventHandler(alt.Enums.EventType.PLAYER_CHANGE_INTERIOR_EVENT, "playerInteriorChange", ({ player, oldInterior, newInterior }) => { return [player, oldInterior, newInterior]; }); + +registerEventHandler(alt.Enums.EventType.PLAYER_DIMENSION_CHANGE, "playerDimensionChange", ({ player, oldDimension, newDimension }) => { + return [player, oldDimension, newDimension]; +}); \ No newline at end of file diff --git a/server/js/events/player.js b/server/js/events/player.js index 970f097d..279e7b20 100644 --- a/server/js/events/player.js +++ b/server/js/events/player.js @@ -7,7 +7,6 @@ Event.register(alt.Enums.EventType.PLAYER_DAMAGE, "PlayerDamage"); Event.register(alt.Enums.EventType.PLAYER_DEATH, "PlayerDeath"); Event.register(alt.Enums.EventType.PLAYER_HEAL, "PlayerHeal"); Event.register(alt.Enums.EventType.PLAYER_REQUEST_CONTROL, "PlayerControlRequest"); -Event.register(alt.Enums.EventType.PLAYER_DIMENSION_CHANGE, "PlayerDimensionChange"); Event.register(alt.Enums.EventType.REQUEST_SYNCED_SCENE, "PlayerSyncedSceneRequest"); Event.register(alt.Enums.EventType.START_SYNCED_SCENE, "PlayerSyncedSceneStart"); Event.register(alt.Enums.EventType.STOP_SYNCED_SCENE, "PlayerSyncedSceneStop"); diff --git a/server/src/events/PlayerEvent.cpp b/server/src/events/PlayerEvent.cpp index 46e51c27..32d9537e 100644 --- a/server/src/events/PlayerEvent.cpp +++ b/server/src/events/PlayerEvent.cpp @@ -74,15 +74,6 @@ static js::Event playerRequestControlEvent(alt::CEvent::Type::PLAYER_REQUEST_CON args.Set("target", e->GetTarget()); }); -static js::Event playerDimensionChangeEvent(alt::CEvent::Type::PLAYER_DIMENSION_CHANGE, [](const alt::CEvent* ev, js::Event::EventArgs& args) -{ - auto e = static_cast(ev); - - args.Set("player", e->GetTarget()); - args.Set("oldDimension", e->GetOldDimension()); - args.Set("newDimension", e->GetNewDimension()); -}); - static js::Event playerWeaponChangeEvent(alt::CEvent::Type::PLAYER_WEAPON_CHANGE, [](const alt::CEvent* ev, js::Event::EventArgs& args) { auto e = static_cast(ev); diff --git a/shared/js/events/player.js b/shared/js/events/player.js index 0e678199..a3ead7ac 100644 --- a/shared/js/events/player.js +++ b/shared/js/events/player.js @@ -7,5 +7,6 @@ Event.register(alt.Enums.EventType.PLAYER_ENTER_VEHICLE, "PlayerVehicleEntered") Event.register(alt.Enums.EventType.PLAYER_LEAVE_VEHICLE, "PlayerVehicleLeft"); Event.register(alt.Enums.EventType.PLAYER_CHANGE_VEHICLE_SEAT, "PlayerVehicleSeatChange"); Event.register(alt.Enums.EventType.PLAYER_CHANGE_INTERIOR_EVENT, "PlayerInteriorChange"); +Event.register(alt.Enums.EventType.PLAYER_DIMENSION_CHANGE, "PlayerDimensionChange"); Event.register(alt.Enums.EventType.PLAYER_START_TALKING, "PlayerStartTalking"); Event.register(alt.Enums.EventType.PLAYER_STOP_TALKING, "PlayerStopTalking"); diff --git a/shared/src/events/PlayerEvent.cpp b/shared/src/events/PlayerEvent.cpp index 753ae078..58d10678 100644 --- a/shared/src/events/PlayerEvent.cpp +++ b/shared/src/events/PlayerEvent.cpp @@ -71,3 +71,12 @@ static js::Event playerInteriorChangeEvent(alt::CEvent::Type::PLAYER_CHANGE_INTE args.Set("oldInterior", e->GetOldInteriorLocation()); args.Set("newInterior", e->GetNewInteriorLocation()); }); + +static js::Event playerDimensionChangeEvent(alt::CEvent::Type::PLAYER_DIMENSION_CHANGE, [](const alt::CEvent* ev, js::Event::EventArgs& args) +{ + auto e = static_cast(ev); + + args.Set("player", e->GetTarget()); + args.Set("oldDimension", e->GetOldDimension()); + args.Set("newDimension", e->GetNewDimension()); +}); \ No newline at end of file