[III] Add ped tab

This commit is contained in:
Grinch_ 2021-10-23 14:15:16 +06:00
parent 88f0276b82
commit de74df71c1
6 changed files with 50 additions and 19 deletions

View File

@ -11,12 +11,12 @@
#pragma once #pragma once
#ifndef GTA3 #ifndef GTA3
#include "animation.h" #include "animation.h"
#include "ped.h"
#include "vehicle.h" #include "vehicle.h"
#include "weapon.h" #include "weapon.h"
#include "game.h" #include "game.h"
#include "visual.h" #include "visual.h"
#endif #endif
#include "ped.h"
#include "player.h" #include "player.h"
#include "teleport.h" #include "teleport.h"
#include "menu.h" #include "menu.h"
@ -35,8 +35,8 @@ private:
#ifdef GTA3 #ifdef GTA3
static inline CallbackTable header static inline CallbackTable header
{ {
{"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Menu", &Menu::Draw}, {"Teleport", &Teleport::Draw}, {"Player", &Player::Draw}, {"Ped", &Ped::Draw},
{"Dummy", nullptr} {"Dummy", nullptr}, {"Menu", &Menu::Draw},
}; };
#else #else
static inline CallbackTable header static inline CallbackTable header

View File

@ -63,7 +63,7 @@ Ped::~Ped()
#ifdef GTASA #ifdef GTASA
void Ped::SpawnPed(std::string& model) void Ped::SpawnPed(std::string& model)
#elif GTAVC #else // GTA3 & GTAVC
void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model) void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
#endif #endif
{ {
@ -73,7 +73,7 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
return; 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(); CPlayerPed* player = FindPlayerPed();
CVector pos = player->GetPosition(); CVector pos = player->GetPosition();
@ -105,9 +105,13 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
currentSlot = 1; currentSlot = 1;
} }
} }
#elif GTAVC #else // GTA3 & GTAVC
if (cat == "Special") // Special model if (cat == "Special") // Special model
{ {
#ifdef GTA3
SetHelpMessage("Spawning special peds isn't implemented yet.", false, false, false);
return;
#else // GTAVC
Command<Commands::LOAD_SPECIAL_CHARACTER>(currentSlot, model.c_str()); Command<Commands::LOAD_SPECIAL_CHARACTER>(currentSlot, model.c_str());
Command<Commands::LOAD_ALL_MODELS_NOW>(); Command<Commands::LOAD_ALL_MODELS_NOW>();
@ -119,6 +123,7 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
{ {
currentSlot = 1; currentSlot = 1;
} }
#endif
} }
#endif #endif
else else
@ -134,15 +139,20 @@ void Ped::SpawnPed(std::string& cat, std::string& name, std::string& model)
ped = CPools::GetPed(hplayer); ped = CPools::GetPed(hplayer);
if (m_SpawnPed::m_bPedMove) if (m_SpawnPed::m_bPedMove)
{
m_SpawnPed::m_List.push_back(ped); m_SpawnPed::m_List.push_back(ped);
}
else else
{ {
Command<Commands::MARK_CHAR_AS_NO_LONGER_NEEDED>(hplayer); Command<Commands::MARK_CHAR_AS_NO_LONGER_NEEDED>(hplayer);
} }
ped->m_nPedFlags.bPedIsBleeding = m_SpawnPed::m_bPedBleed; 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; ped->m_nWeaponAccuracy = m_SpawnPed::m_nAccuracy;
#endif
ped->m_fHealth = m_SpawnPed::m_nPedHealth; ped->m_fHealth = m_SpawnPed::m_nPedHealth;
#ifdef GTASA #ifdef GTASA
if (m_SpawnPed::m_nWeaponId != 0) if (m_SpawnPed::m_nWeaponId != 0)
{ {
@ -185,6 +195,21 @@ void Ped::Draw()
Ui::CheckboxAddress("Slut magnet", 0xA10B5F); Ui::CheckboxAddress("Slut magnet", 0xA10B5F);
ImGui::NextColumn(); ImGui::NextColumn();
Ui::CheckboxAddress("Weapons for all", 0xA10AB3); 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 #endif
ImGui::Columns(1); ImGui::Columns(1);
ImGui::EndChild(); ImGui::EndChild();
@ -314,7 +339,7 @@ void Ped::Draw()
#ifdef GTASA #ifdef GTASA
Ui::DrawImages(m_PedData, SpawnPed, nullptr, Ui::DrawImages(m_PedData, SpawnPed, nullptr,
[](std::string str) { return m_PedData.m_pJson->m_Data[str].get<std::string>(); }); [](std::string str) { return m_PedData.m_pJson->m_Data[str].get<std::string>(); });
#elif GTAVC #else // GTA3 & GTAVC
Ui::DrawJSON(m_PedData, SpawnPed, nullptr); Ui::DrawJSON(m_PedData, SpawnPed, nullptr);
#endif #endif
ImGui::EndTabItem(); ImGui::EndTabItem();

View File

@ -13,7 +13,13 @@ private:
static inline bool m_bThinBody; static inline bool m_bThinBody;
static inline CJson m_SpecialPedJson = CJson("ped special"); static inline CJson m_SpecialPedJson = CJson("ped special");
static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_BOTH, ImVec2(65, 110)}; static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_BOTH, ImVec2(65, 110)};
#elif GTAVC
static inline std::vector<std::string> 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}; static inline ResourceStore m_PedData{"ped", eResourceType::TYPE_TEXT};
#endif #endif
static inline bool m_bImagesLoaded; static inline bool m_bImagesLoaded;
@ -39,14 +45,12 @@ private:
"Civ Male", "Civ Female", "Cop (crash)", "Cubans", "Haitians", "Streetwannabe's", "Diaz' Gang", "Civ Male", "Civ Female", "Cop (crash)", "Cubans", "Haitians", "Streetwannabe's", "Diaz' Gang",
"Security Guards", "Biker Gang", "Vercetti Gang", "Golfers", "Gang 9", "Emergency", "Security Guards", "Biker Gang", "Vercetti Gang", "Golfers", "Gang 9", "Emergency",
"Fireman", "Criminal", "Unused", "Prostitute", "Special" "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 #endif
}; };
}; };
static inline std::vector<std::string> 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; friend class Player;
#ifdef GTASA #ifdef GTASA
@ -61,7 +65,7 @@ public:
#ifdef GTASA #ifdef GTASA
static void SpawnPed(std::string& model); static void SpawnPed(std::string& model);
static void BigHeadEffect(CPed *ped); static void BigHeadEffect(CPed *ped);
#elif GTAVC #else // GTA3 & GTAVC
static void SpawnPed(std::string& cat, std::string& name, std::string& model); static void SpawnPed(std::string& cat, std::string& name, std::string& model);
#endif #endif
}; };

View File

@ -339,10 +339,10 @@ void Player::ChangePlayerModel(std::string& cat, std::string& key, std::string&
#else // GTA3 #else // GTA3
if (cat == "Special") if (cat == "Special")
{ {
// CStreaming::RequestSpecialChar(1, val.c_str(), PRIORITY_REQUEST); // CStreaming::RequestSpecialChar(109, val.c_str(), PRIORITY_REQUEST);
// CStreaming::LoadAllRequestedModels(true); // CStreaming::LoadAllRequestedModels(true);
// player->SetModelIndex(127); // player->SetModelIndex(109);
// CStreaming::SetMissionDoesntRequireSpecialChar(127); // CStreaming::SetMissionDoesntRequireSpecialChar(109);
SetHelpMessage("Spawning special peds isn't implemented yet.", false, false, false); SetHelpMessage("Spawning special peds isn't implemented yet.", false, false, false);
} }
else else

View File

@ -31,7 +31,7 @@ private:
static inline float m_fOffset = 40.0f; static inline float m_fOffset = 40.0f;
}; };
#else // GTA3 & GTAVC #else // GTA3 & GTAVC
static inline ResourceStore skinData{ "skin", eResourceType::TYPE_TEXT }; static inline ResourceStore skinData{ BY_GAME(NULL, "skin", "ped"), eResourceType::TYPE_TEXT };
#endif #endif
public: public:

View File

@ -76,6 +76,8 @@ project "CheatMenuIII"
"../src/animation.cpp", "../src/animation.cpp",
"../src/teleport.h", "../src/teleport.h",
"../src/teleport.cpp", "../src/teleport.cpp",
"../src/ped.h",
"../src/ped.cpp",
"../src/resourcestore.h", "../src/resourcestore.h",
"../src/resourcestore.cpp", "../src/resourcestore.cpp",
"../src/hotkeys.h", "../src/hotkeys.h",