From 5f8788acfbf296d1a27ae64d2771aead0edcf7ba Mon Sep 17 00:00:00 2001 From: OnlyRealNubs <91900600+OnlyRealNubs@users.noreply.github.com> Date: Tue, 21 Feb 2023 18:07:26 -0500 Subject: [PATCH] Added "Makin' My Way Downtown" Effect Spawns an invisible car with a piano attached. Reference to "A Thousand Miles" song. --- ChaosMod/Effects/db/Vehs/VehsSpawner.cpp | 30 ++++++++++++++++++++++++ ConfigApp/Effects.cs | 1 + 2 files changed, 31 insertions(+) diff --git a/ChaosMod/Effects/db/Vehs/VehsSpawner.cpp b/ChaosMod/Effects/db/Vehs/VehsSpawner.cpp index b394342c4..04a85061d 100644 --- a/ChaosMod/Effects/db/Vehs/VehsSpawner.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsSpawner.cpp @@ -346,3 +346,33 @@ REGISTER_EFFECT(OnStartWizardBroom, nullptr, nullptr, EffectInfo .EffectGroupType = EEffectGroupType::SpawnGeneric } ); +// clang-format on + +static void OnStartPianoCar() +{ + static const Hash carHash = 0x1BB290BC; + static const Hash pianoHash = 0xC0217799; + REQUEST_MODEL(carHash); + REQUEST_MODEL(pianoHash); + + Ped player = PLAYER_PED_ID(); + Vector3 playerPos = GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0, 2, 0); + + Vehicle veh = CreatePoolVehicle(carHash, playerPos.x, playerPos.y, playerPos.z, GET_ENTITY_HEADING(player)); + SET_VEHICLE_ENGINE_ON(veh, true, true, false); + SET_VEHICLE_MOD_KIT(veh, 0); + SET_ENTITY_ALPHA(veh, 0, false); + SET_ENTITY_VISIBLE(veh, false, false); + + Object piano = CreatePoolProp(pianoHash, playerPos.x, playerPos.y, playerPos.z, true); + ATTACH_ENTITY_TO_ENTITY(piano, veh, 0, 0, 1.3f, -0.7f, 0, 0, 0, true, false, false, false, 0, true); +} + +// clang-format off +REGISTER_EFFECT(OnStartPianoCar, nullptr, nullptr, EffectInfo + { + .Name = "Makin' My Way Downtown", + .Id = "vehs_spawn_piano", + .EffectGroupType = EEffectGroupType::SpawnGeneric + } +); \ No newline at end of file diff --git a/ConfigApp/Effects.cs b/ConfigApp/Effects.cs index 24a16d084..a5a2b98eb 100644 --- a/ConfigApp/Effects.cs +++ b/ConfigApp/Effects.cs @@ -399,6 +399,7 @@ public enum EffectTimedType { "peds_not_menendez", new EffectInfo("Not Menendez!", EffectCategory.Peds, true) }, { "misc_go_to_jail", new EffectInfo("Bad Boys", EffectCategory.Misc) }, { "misc_muffled_audio", new EffectInfo("Muffled Audio", EffectCategory.Misc, true) }, + { "vehs_spawn_piano", new EffectInfo("Makin' My Way Downtown", EffectCategory.Vehicle) }, }; } }