diff --git a/src/cheatmenu.h b/src/cheatmenu.h index 30364d5..28daf76 100644 --- a/src/cheatmenu.h +++ b/src/cheatmenu.h @@ -11,12 +11,12 @@ #pragma once #ifndef GTA3 #include "animation.h" -#include "ped.h" #include "vehicle.h" #include "weapon.h" #include "game.h" #include "visual.h" #endif +#include "ped.h" #include "player.h" #include "teleport.h" #include "menu.h" @@ -35,8 +35,8 @@ private: #ifdef GTA3 static inline CallbackTable header { - {"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Menu", &Menu::Draw}, - {"Dummy", nullptr} + {"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw}, + {"Dummy", nullptr}, {"Menu", &Menu::Draw}, }; #else static inline CallbackTable header diff --git a/src/ped.cpp b/src/ped.cpp index 6bb24cb..807a917 100644 --- a/src/ped.cpp +++ b/src/ped.cpp @@ -63,7 +63,7 @@ Ped::~Ped() #ifdef GTASA void Ped::SpawnPed(std::string& model) -#elif GTAVC +#else // GTA3 & GTAVC void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model) #endif { @@ -73,7 +73,7 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model) return; } - if (BY_GAME(m_PedData.m_pJson->m_Data.contains(model), true)) + if (BY_GAME(m_PedData.m_pJson->m_Data.contains(model), true, true)) { CPlayerPed* player = FindPlayerPed(); CVector pos = player->GetPosition(); @@ -105,9 +105,13 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model) currentSlot = 1; } } -#elif GTAVC +#else // GTA3 & GTAVC if (cat == "Special") // Special model { +#ifdef GTA3 + SetHelpMessage("Spawning special peds isn't implemented yet.", false, false, false); + return; +#else // GTAVC Command(currentSlot, model.c_str()); Command(); @@ -119,6 +123,7 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model) { currentSlot = 1; } +#endif } #endif else @@ -134,15 +139,20 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model) ped = CPools::GetPed(hplayer); if (m_SpawnPed::m_bPedMove) + { m_SpawnPed::m_List.push_back(ped); + } else { Command(hplayer); } ped->m_nPedFlags.bPedIsBleeding = m_SpawnPed::m_bPedBleed; +#ifdef GTA3 + ped->m_nWepAccuracy = m_SpawnPed::m_nAccuracy; +#else ped->m_nWeaponAccuracy = m_SpawnPed::m_nAccuracy; +#endif ped->m_fHealth = m_SpawnPed::m_nPedHealth; - #ifdef GTASA if (m_SpawnPed::m_nWeaponId != 0) { @@ -185,6 +195,21 @@ void Ped::Draw() Ui::CheckboxAddress("Slut magnet", 0xA10B5F); ImGui::NextColumn(); Ui::CheckboxAddress("Weapons for all", 0xA10AB3); +#else // GTA3 + // Bad idea lol + static bool pedsMayhem; + if (Ui::CheckboxWithHint("Peds mayhem", &pedsMayhem)) + { + Call<0x4911C0>(); + } + static bool everyoneAttacksPlayer; + if (Ui::CheckboxWithHint("Everyone attacks players", &everyoneAttacksPlayer)) + { + Call<0x491270>(); + } + ImGui::NextColumn(); + Ui::CheckboxAddress("Nasty limbs", 0x95CD44); + Ui::CheckboxAddress("Weapons for all", 0x95CCF6); #endif ImGui::Columns(1); ImGui::EndChild(); @@ -314,7 +339,7 @@ void Ped::Draw() #ifdef GTASA Ui::DrawImages(m_PedData, SpawnPed, nullptr, [](std::string str) { return m_PedData.m_pJson->m_Data[str].get(); }); -#elif GTAVC +#else // GTA3 & GTAVC Ui::DrawJSON(m_PedData, SpawnPed, nullptr); #endif ImGui::EndTabItem(); diff --git a/src/ped.h b/src/ped.h index 8bfcbe0..ac731f7 100644 --- a/src/ped.h +++ b/src/ped.h @@ -13,7 +13,13 @@ private: static inline bool m_bThinBody; static inline CJson m_SpecialPedJson = CJson("ped special"); static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_BOTH, ImVec2(65, 110)}; -#elif GTAVC + + static inline std::vector m_GangNames = + { + "Ballas", "Grove street families", "Los santos vagos", "San fierro rifa", + "Da nang boys", "Mafia", "Mountain cloud triad", "Varrio los aztecas", "Gang9", "Gang10" + }; +#else // GTA3 & GTAVC static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_TEXT}; #endif static inline bool m_bImagesLoaded; @@ -39,14 +45,12 @@ private: "Civ Male", "Civ Female", "Cop (crash)", "Cubans", "Haitians", "Streetwannabe's", "Diaz' Gang", "Security Guards", "Biker Gang", "Vercetti Gang", "Golfers", "Gang 9", "Emergency", "Fireman", "Criminal", "Unused", "Prostitute", "Special" +#else // GTA3 + "Civ Male", "Civ Female", "Cop", "Leones", "Triads", "Diablos", "Yakuza", "Yardies", "Colombians", + "Hoods", "unused", "unused", "Emergency", "Fireman", "Criminal", "unused", "Prostitute", "Special" #endif }; }; - static inline std::vector m_GangNames = - { - "Ballas", "Grove street families", "Los santos vagos", "San fierro rifa", - "Da nang boys", "Mafia", "Mountain cloud triad", "Varrio los aztecas", "Gang9", "Gang10" - }; friend class Player; #ifdef GTASA @@ -61,7 +65,7 @@ public: #ifdef GTASA static void SpawnPed(std::string& model); static void BigHeadEffect(CPed *ped); -#elif GTAVC +#else // GTA3 & GTAVC static void SpawnPed(std::string& cat, std::string& name, std::string& model); #endif }; diff --git a/src/player.cpp b/src/player.cpp index ead36d2..dad5723 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -339,10 +339,10 @@ void Player::ChangePlayerModel(std::string& cat, std::string& key, std::string& #else // GTA3 if (cat == "Special") { - // CStreaming::RequestSpecialChar(1, val.c_str(), PRIORITY_REQUEST); + // CStreaming::RequestSpecialChar(109, val.c_str(), PRIORITY_REQUEST); // CStreaming::LoadAllRequestedModels(true); - // player->SetModelIndex(127); - // CStreaming::SetMissionDoesntRequireSpecialChar(127); + // player->SetModelIndex(109); + // CStreaming::SetMissionDoesntRequireSpecialChar(109); SetHelpMessage("Spawning special peds isn't implemented yet.", false, false, false); } else diff --git a/src/player.h b/src/player.h index 868ecda..e68b36c 100644 --- a/src/player.h +++ b/src/player.h @@ -31,7 +31,7 @@ private: static inline float m_fOffset = 40.0f; }; #else // GTA3 & GTAVC - static inline ResourceStore skinData{ "skin", eResourceType::TYPE_TEXT }; + static inline ResourceStore skinData{ BY_GAME(NULL, "skin", "ped"), eResourceType::TYPE_TEXT }; #endif public: diff --git a/tools/premake5.lua b/tools/premake5.lua index 29bc6d2..665b23a 100644 --- a/tools/premake5.lua +++ b/tools/premake5.lua @@ -76,6 +76,8 @@ project "CheatMenuIII" "../src/animation.cpp", "../src/teleport.h", "../src/teleport.cpp", + "../src/ped.h", + "../src/ped.cpp", "../src/resourcestore.h", "../src/resourcestore.cpp", "../src/hotkeys.h",