2020-12-02 16:19:16 -05:00
|
|
|
#include "pch.h"
|
|
|
|
#include "Player.h"
|
|
|
|
#include "Menu.h"
|
2021-01-03 06:48:07 -05:00
|
|
|
#include "Ui.h"
|
|
|
|
#include "Util.h"
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
|
|
|
#include "Ped.h"
|
|
|
|
|
2021-07-17 09:42:09 -04:00
|
|
|
// hardcoded cloth category names
|
|
|
|
const char* cloth_category[18] =
|
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
"Shirts",
|
2021-07-22 18:35:20 -04:00
|
|
|
"Heads",
|
2021-08-06 11:53:18 -04:00
|
|
|
"Trousers",
|
|
|
|
"Shoes",
|
|
|
|
"Tattoos left lower arm",
|
|
|
|
"Tattoos left upper arm",
|
|
|
|
"Tattoos right upper arm",
|
|
|
|
"Tattoos right lower arm",
|
|
|
|
"Tattoos back",
|
|
|
|
"Tattoos left chest",
|
2021-07-22 18:35:20 -04:00
|
|
|
"Tattoos right chest",
|
2021-08-06 11:53:18 -04:00
|
|
|
"Tattoos stomach",
|
2021-07-22 18:35:20 -04:00
|
|
|
"Tattoos lower back",
|
2021-08-06 11:53:18 -04:00
|
|
|
"Necklaces",
|
|
|
|
"Watches",
|
|
|
|
"Glasses",
|
|
|
|
"Hats",
|
2021-07-22 18:35:20 -04:00
|
|
|
"Extras"
|
2021-07-17 09:42:09 -04:00
|
|
|
};
|
|
|
|
|
2021-03-02 14:18:37 -05:00
|
|
|
inline static void PlayerModelBrokenFix()
|
2020-12-28 15:12:40 -05:00
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
CPlayerPed* pPlayer = FindPlayerPed();
|
2020-12-28 15:12:40 -05:00
|
|
|
|
2021-06-18 12:49:11 -04:00
|
|
|
if (pPlayer->m_nModelIndex == 0)
|
|
|
|
Call<0x5A81E0>(0, pPlayer->m_pPlayerData->m_pPedClothesDesc, 0xBC1C78, false);
|
2020-12-28 15:12:40 -05:00
|
|
|
}
|
2021-08-25 06:06:21 -04:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Taken from gta chaos mod by Lordmau5
|
|
|
|
https://github.com/gta-chaos-mod/Trilogy-ASI-Script
|
|
|
|
*/
|
|
|
|
void Player::TopDownCameraView()
|
|
|
|
{
|
|
|
|
CPlayerPed *player = FindPlayerPed ();
|
|
|
|
CVector pos = player->GetPosition ();
|
|
|
|
float curOffset = m_TopDownCamera::m_fOffset;
|
|
|
|
|
|
|
|
// drunk effect causes issues
|
|
|
|
Command<eScriptCommands::COMMAND_SET_PLAYER_DRUNKENNESS> (0, 0);
|
|
|
|
|
|
|
|
CVehicle *vehicle = FindPlayerVehicle(-1, false);
|
|
|
|
|
|
|
|
// TODO: implement smooth transition
|
|
|
|
if (vehicle)
|
|
|
|
{
|
|
|
|
float speed = vehicle->m_vecMoveSpeed.Magnitude();
|
|
|
|
if (speed > 1.2f)
|
|
|
|
{
|
|
|
|
speed = 1.2f;
|
|
|
|
}
|
|
|
|
if (speed * 40.0f > 40.0f)
|
|
|
|
{
|
|
|
|
speed = 40.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (speed < 0.0f)
|
|
|
|
{
|
|
|
|
speed = 0.0f;
|
|
|
|
}
|
|
|
|
curOffset += speed;
|
|
|
|
}
|
|
|
|
|
|
|
|
CVector playerOffset = CVector (pos.x, pos.y, pos.z + 2.0f);
|
|
|
|
CVector cameraPos
|
|
|
|
= CVector (playerOffset.x, playerOffset.y, playerOffset.z + curOffset);
|
|
|
|
|
|
|
|
CColPoint outColPoint;
|
|
|
|
CEntity * outEntity;
|
|
|
|
|
|
|
|
// TODO: Which variable? X, Y or Z for the look direction?
|
|
|
|
|
|
|
|
if (CWorld::ProcessLineOfSight (playerOffset, cameraPos, outColPoint,
|
|
|
|
outEntity, true, true, true, true, true,
|
|
|
|
true, true, true))
|
|
|
|
{
|
|
|
|
Command<eScriptCommands::COMMAND_SET_FIXED_CAMERA_POSITION> (
|
|
|
|
outColPoint.m_vecPoint.x, outColPoint.m_vecPoint.y,
|
|
|
|
outColPoint.m_vecPoint.z, 0.0f, 0.0f, 0.0f);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Command<eScriptCommands::COMMAND_SET_FIXED_CAMERA_POSITION> (
|
|
|
|
cameraPos.x, cameraPos.y, cameraPos.z, 0.0f, 0.0f, 0.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
Command<eScriptCommands::COMMAND_POINT_CAMERA_AT_POINT> (pos.x, pos.y,
|
|
|
|
pos.z, 2);
|
|
|
|
|
|
|
|
TheCamera.m_fGenerationDistMultiplier = 10.0f;
|
|
|
|
TheCamera.m_fLODDistMultiplier = 10.0f;
|
|
|
|
}
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
2020-12-28 15:12:40 -05:00
|
|
|
|
2020-12-02 16:19:16 -05:00
|
|
|
Player::Player()
|
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
|
|
|
// Fix player model being broken after rebuild
|
2021-02-24 16:54:45 -05:00
|
|
|
patch::RedirectCall(0x5A834D, &PlayerModelBrokenFix);
|
2021-06-18 12:49:11 -04:00
|
|
|
m_bAimSkinChanger = config.GetValue("aim_skin_changer", false);
|
2021-08-07 12:01:44 -04:00
|
|
|
#endif
|
2020-12-02 16:19:16 -05:00
|
|
|
|
2021-02-24 16:54:45 -05:00
|
|
|
// Custom skins setup
|
|
|
|
if (GetModuleHandle("modloader.asi"))
|
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2021-06-19 09:00:13 -04:00
|
|
|
if (fs::is_directory(m_CustomSkins::m_Path))
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-06-19 09:00:13 -04:00
|
|
|
for (auto& p : fs::recursive_directory_iterator(m_CustomSkins::m_Path))
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-02-24 16:54:45 -05:00
|
|
|
if (p.path().extension() == ".dff")
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-02-24 16:54:45 -05:00
|
|
|
std::string file_name = p.path().stem().string();
|
2020-12-02 16:19:16 -05:00
|
|
|
|
2021-02-24 16:54:45 -05:00
|
|
|
if (file_name.size() < 9)
|
2021-06-19 09:00:13 -04:00
|
|
|
m_CustomSkins::m_List.push_back(file_name);
|
2021-02-24 16:54:45 -05:00
|
|
|
else
|
2021-02-25 17:45:41 -05:00
|
|
|
flog << "Custom Skin longer than 8 characters " << file_name << std::endl;
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-08-06 11:53:18 -04:00
|
|
|
else
|
|
|
|
{
|
|
|
|
fs::create_directory(m_CustomSkins::m_Path);
|
|
|
|
}
|
|
|
|
#endif
|
2021-02-24 16:54:45 -05:00
|
|
|
|
2021-06-18 12:49:11 -04:00
|
|
|
m_bModloaderInstalled = true;
|
2021-02-24 16:54:45 -05:00
|
|
|
}
|
2020-12-02 16:19:16 -05:00
|
|
|
|
|
|
|
Events::processScriptsEvent += []
|
|
|
|
{
|
|
|
|
uint timer = CTimer::m_snTimeInMilliseconds;
|
2021-08-06 11:53:18 -04:00
|
|
|
CPlayerPed* player = FindPlayerPed();
|
|
|
|
int hplayer = CPools::GetPedRef(player);
|
|
|
|
|
2021-06-19 09:00:13 -04:00
|
|
|
if (m_KeepPosition::m_bEnabled)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
if (Command<Commands::IS_CHAR_DEAD>(hplayer))
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-06-19 09:00:13 -04:00
|
|
|
m_KeepPosition::m_fPos = player->GetPosition();
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CVector cur_pos = player->GetPosition();
|
|
|
|
|
2021-06-19 09:00:13 -04:00
|
|
|
if (m_KeepPosition::m_fPos.x != 0 && m_KeepPosition::m_fPos.x != cur_pos.x
|
|
|
|
&& m_KeepPosition::m_fPos.y != 0 && m_KeepPosition::m_fPos.y != cur_pos.y)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
BY_GAME(player->Teleport(m_KeepPosition::m_fPos, false)
|
|
|
|
, player->Teleport(m_KeepPosition::m_fPos));
|
2021-06-19 09:00:13 -04:00
|
|
|
m_KeepPosition::m_fPos = CVector(0, 0, 0);
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-18 12:49:11 -04:00
|
|
|
if (m_bGodMode)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2020-12-02 16:19:16 -05:00
|
|
|
patch::Set<bool>(0x96916D, 1, false);
|
|
|
|
player->m_nPhysicalFlags.bBulletProof = 1;
|
|
|
|
player->m_nPhysicalFlags.bCollisionProof = 1;
|
|
|
|
player->m_nPhysicalFlags.bExplosionProof = 1;
|
|
|
|
player->m_nPhysicalFlags.bFireProof = 1;
|
2021-08-06 11:53:18 -04:00
|
|
|
player->m_nPhysicalFlags.bMeeleProof = 1;
|
|
|
|
#elif GTAVC
|
|
|
|
player->m_nFlags.bBulletProof = 1;
|
|
|
|
player->m_nFlags.bCollisionProof = 1;
|
|
|
|
player->m_nFlags.bExplosionProof = 1;
|
|
|
|
player->m_nFlags.bFireProof = 1;
|
|
|
|
player->m_nFlags.bMeleeProof = 1;
|
|
|
|
#endif
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
2021-02-24 16:54:45 -05:00
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2021-08-28 01:13:18 -04:00
|
|
|
if (m_bDrunkEffect && !m_TopDownCamera::m_bEnabled)
|
|
|
|
{
|
|
|
|
Command<eScriptCommands::COMMAND_SET_PLAYER_DRUNKENNESS> (0, 100);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_TopDownCamera::m_bEnabled)
|
|
|
|
{
|
|
|
|
TopDownCameraView();
|
|
|
|
}
|
|
|
|
|
2021-06-19 09:00:13 -04:00
|
|
|
if (m_bAimSkinChanger && Ui::HotKeyPressed(Menu::m_HotKeys::aimSkinChanger))
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
CPed* targetPed = player->m_pPlayerTargettedPed;
|
|
|
|
if (targetPed)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
player->SetModelIndex(targetPed->m_nModelIndex);
|
2020-12-02 16:19:16 -05:00
|
|
|
Util::ClearCharTasksVehCheck(player);
|
|
|
|
}
|
|
|
|
}
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
2021-01-18 04:53:24 -05:00
|
|
|
|
2021-06-19 09:00:13 -04:00
|
|
|
if (Ui::HotKeyPressed(Menu::m_HotKeys::godMode))
|
2021-01-18 04:53:24 -05:00
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
if (m_bGodMode)
|
2021-01-18 04:53:24 -05:00
|
|
|
{
|
2021-08-01 21:41:48 -04:00
|
|
|
SetHelpMessage("God mode disabled", false, false, false);
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2021-06-18 12:49:11 -04:00
|
|
|
patch::Set<bool>(0x96916D, m_bGodMode, false);
|
2021-08-06 11:53:18 -04:00
|
|
|
player->m_nPhysicalFlags.bBulletProof = 0;
|
|
|
|
player->m_nPhysicalFlags.bCollisionProof = 0;
|
|
|
|
player->m_nPhysicalFlags.bExplosionProof = 0;
|
|
|
|
player->m_nPhysicalFlags.bFireProof = 0;
|
|
|
|
player->m_nPhysicalFlags.bMeeleProof = 0;
|
|
|
|
#elif GTAVC
|
|
|
|
player->m_nFlags.bBulletProof = 0;
|
|
|
|
player->m_nFlags.bCollisionProof = 0;
|
|
|
|
player->m_nFlags.bExplosionProof = 0;
|
|
|
|
player->m_nFlags.bFireProof = 0;
|
|
|
|
player->m_nFlags.bMeleeProof = 0;
|
|
|
|
#endif
|
2021-06-18 12:49:11 -04:00
|
|
|
m_bGodMode = false;
|
2021-01-18 04:53:24 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-08-01 21:41:48 -04:00
|
|
|
SetHelpMessage("God mode enabled", false, false, false);
|
2021-06-18 12:49:11 -04:00
|
|
|
m_bGodMode = true;
|
2021-01-18 04:53:24 -05:00
|
|
|
}
|
|
|
|
}
|
2020-12-02 16:19:16 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2021-02-24 16:54:45 -05:00
|
|
|
void Player::ChangePlayerCloth(std::string& name)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
|
|
|
std::stringstream ss(name);
|
|
|
|
std::string temp;
|
|
|
|
|
|
|
|
getline(ss, temp, '$');
|
|
|
|
int body_part = std::stoi(temp);
|
|
|
|
|
|
|
|
getline(ss, temp, '$');
|
|
|
|
std::string model = temp.c_str();
|
|
|
|
|
|
|
|
getline(ss, temp, '$');
|
2021-08-27 23:12:20 -04:00
|
|
|
std::string texName = temp.c_str();
|
2020-12-02 16:19:16 -05:00
|
|
|
|
2021-02-24 16:54:45 -05:00
|
|
|
CPlayerPed* player = FindPlayerPed();
|
2020-12-02 16:19:16 -05:00
|
|
|
|
2021-08-27 23:12:20 -04:00
|
|
|
if (texName == "cutoffchinosblue")
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
|
|
|
player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(-697413025, 744365350, body_part);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-08-27 23:12:20 -04:00
|
|
|
if (texName == "sneakerbincblue")
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
|
|
|
player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(-915574819, 2099005073, body_part);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-08-27 23:12:20 -04:00
|
|
|
if (texName == "12myfac")
|
|
|
|
{
|
2020-12-02 16:19:16 -05:00
|
|
|
player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(-1750049245, 1393983095, body_part);
|
2021-08-27 23:12:20 -04:00
|
|
|
}
|
2020-12-02 16:19:16 -05:00
|
|
|
else
|
2021-08-27 23:12:20 -04:00
|
|
|
{
|
|
|
|
player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(texName.c_str(), model.c_str(), body_part);
|
|
|
|
}
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
CClothes::RebuildPlayer(player, false);
|
|
|
|
}
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
2020-12-02 16:19:16 -05:00
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2020-12-02 16:19:16 -05:00
|
|
|
void Player::ChangePlayerModel(std::string& model)
|
|
|
|
{
|
2021-06-19 09:00:13 -04:00
|
|
|
bool custom_skin = std::find(m_CustomSkins::m_List.begin(), m_CustomSkins::m_List.end(), model) !=
|
|
|
|
m_CustomSkins::m_List.end();
|
2021-08-06 11:53:18 -04:00
|
|
|
|
2021-08-12 23:28:19 -04:00
|
|
|
if (Ped::m_PedData.m_pJson->m_Data.contains(model) || custom_skin)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-02-24 16:54:45 -05:00
|
|
|
CPlayerPed* player = FindPlayerPed();
|
2021-06-18 12:49:11 -04:00
|
|
|
if (Ped::m_SpecialPedJson.m_Data.contains(model) || custom_skin)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
|
|
|
std::string name;
|
2021-06-18 12:49:11 -04:00
|
|
|
if (Ped::m_SpecialPedJson.m_Data.contains(model))
|
|
|
|
name = Ped::m_SpecialPedJson.m_Data[model].get<std::string>().c_str();
|
2020-12-02 16:19:16 -05:00
|
|
|
else
|
|
|
|
name = model;
|
|
|
|
|
|
|
|
CStreaming::RequestSpecialChar(1, name.c_str(), PRIORITY_REQUEST);
|
|
|
|
CStreaming::LoadAllRequestedModels(true);
|
|
|
|
|
|
|
|
player->SetModelIndex(291);
|
|
|
|
|
|
|
|
CStreaming::SetSpecialCharIsDeletable(291);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int imodel = std::stoi(model);
|
|
|
|
|
2021-02-24 16:54:45 -05:00
|
|
|
CStreaming::RequestModel(imodel, eStreamingFlags::PRIORITY_REQUEST);
|
2020-12-02 16:19:16 -05:00
|
|
|
CStreaming::LoadAllRequestedModels(false);
|
|
|
|
player->SetModelIndex(imodel);
|
|
|
|
CStreaming::SetModelIsDeletable(imodel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-08-06 11:53:18 -04:00
|
|
|
#elif GTAVC
|
|
|
|
void Player::ChangePlayerModel(std::string& cat, std::string& name, std::string& id)
|
|
|
|
{
|
|
|
|
CPlayerPed* player = FindPlayerPed();
|
|
|
|
player->Undress(id.c_str());
|
|
|
|
CStreaming::LoadAllRequestedModels(false);
|
|
|
|
player->Dress();
|
|
|
|
}
|
|
|
|
#endif
|
2020-12-02 16:19:16 -05:00
|
|
|
|
2021-02-24 16:54:45 -05:00
|
|
|
void Player::Draw()
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
CPlayerPed* pPlayer = FindPlayerPed();
|
|
|
|
int hplayer = CPools::GetPedRef(pPlayer);
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2021-06-18 12:49:11 -04:00
|
|
|
CPad* pad = pPlayer->GetPadFromPlayer();
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
|
|
|
CPlayerInfo *pInfo = &CWorld::Players[CWorld::PlayerInFocus];
|
2020-12-02 16:19:16 -05:00
|
|
|
|
|
|
|
if (ImGui::Button("Copy coordinates", ImVec2(Ui::GetSize(2))))
|
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
CVector pos = pPlayer->GetPosition();
|
2020-12-02 16:19:16 -05:00
|
|
|
std::string text = std::to_string(pos.x) + ", " + std::to_string(pos.y) + ", " + std::to_string(pos.z);
|
|
|
|
|
|
|
|
ImGui::SetClipboardText(text.c_str());
|
2021-08-01 21:41:48 -04:00
|
|
|
SetHelpMessage("Coordinates copied", false, false, false);
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if (ImGui::Button("Suicide", ImVec2(Ui::GetSize(2))))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
pPlayer->m_fHealth = 0.0;
|
2021-08-06 11:53:18 -04:00
|
|
|
}
|
2021-02-24 16:54:45 -05:00
|
|
|
|
2020-12-02 16:19:16 -05:00
|
|
|
ImGui::Spacing();
|
|
|
|
|
|
|
|
if (ImGui::BeginTabBar("Player", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll))
|
|
|
|
{
|
|
|
|
if (ImGui::BeginTabItem("Checkboxes"))
|
|
|
|
{
|
|
|
|
ImGui::Spacing();
|
|
|
|
|
|
|
|
ImGui::BeginChild("CheckboxesChild");
|
|
|
|
|
|
|
|
ImGui::Columns(2, 0, false);
|
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2021-08-25 06:06:21 -04:00
|
|
|
Ui::CheckboxAddress("Bounty on yourself", 0x96913F);
|
|
|
|
|
|
|
|
ImGui::BeginDisabled(m_TopDownCamera::m_bEnabled);
|
|
|
|
if (Ui::CheckboxWithHint("Drunk effect", &m_bDrunkEffect))
|
|
|
|
{
|
|
|
|
if (!m_bDrunkEffect)
|
|
|
|
{
|
|
|
|
Command<eScriptCommands::COMMAND_SET_PLAYER_DRUNKENNESS> (0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (Ui::CheckboxWithHint("Fast Sprint", &m_bFastSprint, "Best to enable God Mode & Infinite sprint too"))
|
|
|
|
{
|
|
|
|
if(m_bFastSprint)
|
|
|
|
{
|
|
|
|
patch::Set<float>(0x8D2458, 0.1f);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
patch::Set<float>(0x8D2458, 5.0f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ImGui::EndDisabled();
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
|
|
|
Ui::CheckboxAddress("Free healthcare", (int)&pInfo->m_bFreeHealthCare);
|
|
|
|
|
2021-06-18 12:49:11 -04:00
|
|
|
if (Ui::CheckboxWithHint("God mode", &m_bGodMode))
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2021-06-18 12:49:11 -04:00
|
|
|
patch::Set<bool>(0x96916D, m_bGodMode, false);
|
|
|
|
pPlayer->m_nPhysicalFlags.bBulletProof = m_bGodMode;
|
|
|
|
pPlayer->m_nPhysicalFlags.bCollisionProof = m_bGodMode;
|
|
|
|
pPlayer->m_nPhysicalFlags.bExplosionProof = m_bGodMode;
|
|
|
|
pPlayer->m_nPhysicalFlags.bFireProof = m_bGodMode;
|
|
|
|
pPlayer->m_nPhysicalFlags.bMeeleProof = m_bGodMode;
|
2021-08-06 11:53:18 -04:00
|
|
|
#elif GTAVC
|
|
|
|
pPlayer->m_nFlags.bBulletProof = m_bGodMode;
|
|
|
|
pPlayer->m_nFlags.bCollisionProof = m_bGodMode;
|
|
|
|
pPlayer->m_nFlags.bExplosionProof = m_bGodMode;
|
|
|
|
pPlayer->m_nFlags.bFireProof = m_bGodMode;
|
|
|
|
pPlayer->m_nFlags.bMeleeProof = m_bGodMode;
|
|
|
|
#endif
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2020-12-02 16:19:16 -05:00
|
|
|
Ui::CheckboxAddress("Higher cycle jumps", 0x969161);
|
|
|
|
Ui::CheckboxAddress("Infinite oxygen", 0x96916E);
|
2021-06-18 12:49:11 -04:00
|
|
|
if (Ui::CheckboxBitFlag("Invisible player", pPlayer->m_nPedFlags.bDontRender))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
pPlayer->m_nPedFlags.bDontRender = (pPlayer->m_nPedFlags.bDontRender == 1) ? 0 : 1;
|
2021-08-06 11:53:18 -04:00
|
|
|
}
|
|
|
|
#elif GTAVC
|
2021-08-25 06:06:21 -04:00
|
|
|
Ui::CheckboxAddress("Infinite sprint", (int)&pInfo->m_bNeverGetsTired);
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
2021-02-24 16:54:45 -05:00
|
|
|
|
2020-12-02 16:19:16 -05:00
|
|
|
ImGui::NextColumn();
|
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2021-08-25 06:06:21 -04:00
|
|
|
Ui::CheckboxAddress("Infinite sprint", 0xB7CEE4);
|
2020-12-02 16:19:16 -05:00
|
|
|
if (Ui::CheckboxBitFlag("Lock control", pad->bPlayerSafe))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
2020-12-02 16:19:16 -05:00
|
|
|
pad->bPlayerSafe = (pad->bPlayerSafe == 1) ? 0 : 1;
|
2021-08-06 11:53:18 -04:00
|
|
|
}
|
2020-12-02 16:19:16 -05:00
|
|
|
Ui::CheckboxAddress("Mega jump", 0x96916C);
|
|
|
|
Ui::CheckboxAddress("Mega punch", 0x969173);
|
|
|
|
Ui::CheckboxAddress("Never get hungry", 0x969174);
|
|
|
|
|
2021-02-24 16:54:45 -05:00
|
|
|
bool never_wanted = patch::Get<bool>(0x969171, false);
|
2020-12-02 16:19:16 -05:00
|
|
|
if (Ui::CheckboxWithHint("Never wanted", &never_wanted))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
2020-12-02 16:19:16 -05:00
|
|
|
CCheat::NotWantedCheat();
|
2021-08-06 11:53:18 -04:00
|
|
|
}
|
2021-08-23 09:40:53 -04:00
|
|
|
#elif GTAVC
|
|
|
|
static bool neverWanted = false;
|
|
|
|
if (Ui::CheckboxWithHint("Never wanted", &neverWanted))
|
|
|
|
{
|
|
|
|
if (neverWanted)
|
|
|
|
{
|
|
|
|
pPlayer->m_pWanted->CheatWantedLevel(0);
|
|
|
|
pPlayer->m_pWanted->Update();
|
|
|
|
patch::SetRaw(0x4D2110, (char*)"\xC3\x90\x90\x90\x90\x90", 6); // CWanted::UpdateWantedLevel()
|
|
|
|
patch::Nop(0x5373D0, 5); // CWanted::Update();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pPlayer->m_pWanted->CheatWantedLevel(0);
|
|
|
|
pPlayer->m_pWanted->ClearQdCrimes();
|
|
|
|
patch::SetRaw(0x4D2110, (char*)"\x8B\x15\xDC\x10\x69\x00", 6);
|
|
|
|
patch::SetRaw(0x5373D0, (char*)"\xE8\x8B\xAE\xF9\xFF", 5);
|
|
|
|
}
|
|
|
|
}
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
|
|
|
Ui::CheckboxAddress("No arrest fee", (int)&pInfo->m_bGetOutOfJailFree);
|
2021-08-25 06:06:21 -04:00
|
|
|
Ui::CheckboxWithHint("Respawn die location", &m_KeepPosition::m_bEnabled, "Respawn to the location you died from");
|
2021-02-24 16:54:45 -05:00
|
|
|
|
2020-12-02 16:19:16 -05:00
|
|
|
ImGui::Columns(1);
|
|
|
|
|
2021-07-22 18:35:20 -04:00
|
|
|
ImGui::NewLine();
|
|
|
|
ImGui::TextWrapped("Player flags,");
|
|
|
|
|
|
|
|
ImGui::Columns(2, 0, false);
|
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
bool state = BY_GAME(pPlayer->m_nPhysicalFlags.bBulletProof, pPlayer->m_nFlags.bBulletProof);
|
2021-07-22 18:35:20 -04:00
|
|
|
if (Ui::CheckboxWithHint("Bullet proof", &state, nullptr, m_bGodMode))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
|
|
|
BY_GAME(pPlayer->m_nPhysicalFlags.bBulletProof, pPlayer->m_nFlags.bBulletProof) = state;
|
|
|
|
}
|
2021-07-22 18:35:20 -04:00
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
state = BY_GAME(pPlayer->m_nPhysicalFlags.bCollisionProof, pPlayer->m_nFlags.bCollisionProof);
|
2021-07-22 18:35:20 -04:00
|
|
|
if (Ui::CheckboxWithHint("Collision proof", &state, nullptr, m_bGodMode))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
|
|
|
BY_GAME(pPlayer->m_nPhysicalFlags.bCollisionProof, pPlayer->m_nFlags.bCollisionProof) = state;
|
|
|
|
}
|
2021-07-22 18:35:20 -04:00
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
state = BY_GAME(pPlayer->m_nPhysicalFlags.bExplosionProof, pPlayer->m_nFlags.bExplosionProof);
|
2021-07-22 18:35:20 -04:00
|
|
|
if (Ui::CheckboxWithHint("Explosion proof", &state, nullptr, m_bGodMode))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
|
|
|
BY_GAME(pPlayer->m_nPhysicalFlags.bExplosionProof, pPlayer->m_nFlags.bExplosionProof) = state;
|
|
|
|
}
|
2021-07-22 18:35:20 -04:00
|
|
|
|
|
|
|
ImGui::NextColumn();
|
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
state = BY_GAME(pPlayer->m_nPhysicalFlags.bFireProof, pPlayer->m_nFlags.bFireProof);
|
2021-07-22 18:35:20 -04:00
|
|
|
if (Ui::CheckboxWithHint("Fire proof", &state, nullptr, m_bGodMode))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
|
|
|
BY_GAME(pPlayer->m_nPhysicalFlags.bFireProof, pPlayer->m_nFlags.bFireProof) = state;
|
|
|
|
}
|
2021-07-22 18:35:20 -04:00
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
state = BY_GAME(pPlayer->m_nPhysicalFlags.bMeeleProof, pPlayer->m_nFlags.bMeleeProof);
|
2021-07-22 18:35:20 -04:00
|
|
|
if (Ui::CheckboxWithHint("Meele proof", &state, nullptr, m_bGodMode))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
|
|
|
BY_GAME(pPlayer->m_nPhysicalFlags.bMeeleProof, pPlayer->m_nFlags.bMeleeProof) = state;
|
|
|
|
}
|
2021-07-22 18:35:20 -04:00
|
|
|
|
2020-12-02 16:19:16 -05:00
|
|
|
ImGui::EndChild();
|
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ImGui::BeginTabItem("Menus"))
|
|
|
|
{
|
|
|
|
ImGui::BeginChild("PlayerMenus");
|
|
|
|
|
2021-06-18 12:49:11 -04:00
|
|
|
Ui::EditReference("Armour", pPlayer->m_fArmour, 0, 100, 150);
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2020-12-02 16:19:16 -05:00
|
|
|
if (ImGui::CollapsingHeader("Body"))
|
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
if (pPlayer->m_nModelIndex == 0)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
|
|
|
ImGui::Columns(3, 0, false);
|
2021-06-18 12:49:11 -04:00
|
|
|
if (ImGui::RadioButton("Fat", &m_nUiBodyState, 2))
|
2020-12-02 16:19:16 -05:00
|
|
|
CCheat::FatCheat();
|
|
|
|
|
|
|
|
ImGui::NextColumn();
|
|
|
|
|
2021-06-18 12:49:11 -04:00
|
|
|
if (ImGui::RadioButton("Muscle", &m_nUiBodyState, 1))
|
2020-12-02 16:19:16 -05:00
|
|
|
CCheat::MuscleCheat();
|
|
|
|
|
|
|
|
ImGui::NextColumn();
|
|
|
|
|
2021-06-18 12:49:11 -04:00
|
|
|
if (ImGui::RadioButton("Skinny", &m_nUiBodyState, 0))
|
2020-12-02 16:19:16 -05:00
|
|
|
CCheat::SkinnyCheat();
|
|
|
|
|
|
|
|
ImGui::Columns(1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ImGui::TextWrapped("You need to be in CJ skin.");
|
|
|
|
ImGui::Spacing();
|
|
|
|
|
|
|
|
if (ImGui::Button("Change to CJ skin", ImVec2(Ui::GetSize(1))))
|
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
pPlayer->SetModelIndex(0);
|
|
|
|
Util::ClearCharTasksVehCheck(pPlayer);
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
ImGui::Spacing();
|
|
|
|
ImGui::Separator();
|
|
|
|
}
|
|
|
|
|
|
|
|
Ui::EditStat("Energy", STAT_ENERGY);
|
|
|
|
Ui::EditStat("Fat", STAT_FAT);
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
|
|
|
Ui::EditReference("Health", pPlayer->m_fHealth, 0, 100, BY_GAME(static_cast<int>(pPlayer->m_fMaxHealth), 100));
|
|
|
|
#ifdef GTASA
|
2020-12-02 16:19:16 -05:00
|
|
|
Ui::EditStat("Lung capacity", STAT_LUNG_CAPACITY);
|
2021-02-24 16:54:45 -05:00
|
|
|
Ui::EditStat("Max health", STAT_MAX_HEALTH, 0, 569, 1450);
|
2020-12-02 16:19:16 -05:00
|
|
|
Ui::EditAddress<int>("Money", 0xB7CE50, -99999999, 0, 99999999);
|
2021-08-06 11:53:18 -04:00
|
|
|
#elif GTAVC
|
|
|
|
int money = pInfo->m_nMoney;
|
|
|
|
Ui::EditAddress<int>("Money", (int)&money, -9999999, 0, 99999999);
|
|
|
|
pInfo->m_nMoney = money;
|
|
|
|
pInfo->m_nDisplayMoney = money;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef GTASA
|
2020-12-02 16:19:16 -05:00
|
|
|
Ui::EditStat("Muscle", STAT_MUSCLE);
|
|
|
|
Ui::EditStat("Respect", STAT_RESPECT);
|
|
|
|
Ui::EditStat("Stamina", STAT_STAMINA);
|
2021-08-25 06:06:21 -04:00
|
|
|
if (ImGui::CollapsingHeader("Top down camera"))
|
|
|
|
{
|
|
|
|
if (ImGui::Checkbox("Enabled", &m_TopDownCamera::m_bEnabled))
|
|
|
|
{
|
|
|
|
Command<Commands::RESTORE_CAMERA_JUMPCUT>();
|
|
|
|
}
|
|
|
|
ImGui::Spacing();
|
|
|
|
ImGui::SliderFloat("Camera zoom", &m_TopDownCamera::m_fOffset, 20.0f, 60.0f);
|
|
|
|
ImGui::Spacing();
|
|
|
|
ImGui::Separator();
|
|
|
|
}
|
2021-08-06 11:53:18 -04:00
|
|
|
#endif
|
2020-12-02 16:19:16 -05:00
|
|
|
if (ImGui::CollapsingHeader("Wanted level"))
|
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2021-06-18 12:49:11 -04:00
|
|
|
int val = pPlayer->m_pPlayerData->m_pWanted->m_nWantedLevel;
|
|
|
|
int max_wl = pPlayer->m_pPlayerData->m_pWanted->MaximumWantedLevel;
|
2021-08-06 11:53:18 -04:00
|
|
|
max_wl = max_wl < 6 ? 6 : max_wl;
|
|
|
|
#elif GTAVC
|
|
|
|
int val = pPlayer->m_pWanted->m_nWantedLevel;
|
|
|
|
int max_wl = 6;
|
|
|
|
#endif
|
2020-12-02 16:19:16 -05:00
|
|
|
|
|
|
|
ImGui::Columns(3, 0, false);
|
|
|
|
ImGui::Text("Min: 0");
|
|
|
|
ImGui::NextColumn();
|
|
|
|
ImGui::Text("Def: 0");
|
|
|
|
ImGui::NextColumn();
|
2021-02-24 16:54:45 -05:00
|
|
|
ImGui::Text("Max: %d", max_wl);
|
2020-12-02 16:19:16 -05:00
|
|
|
ImGui::Columns(1);
|
|
|
|
|
|
|
|
ImGui::Spacing();
|
|
|
|
|
|
|
|
if (ImGui::InputInt("Set value##Wanted level", &val))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
|
|
|
#ifdef GTASA
|
2021-06-18 12:49:11 -04:00
|
|
|
pPlayer->CheatWantedLevel(val);
|
2021-08-06 11:53:18 -04:00
|
|
|
#elif GTAVC
|
|
|
|
pPlayer->m_pWanted->CheatWantedLevel(val);
|
|
|
|
#endif
|
|
|
|
}
|
2021-02-24 16:54:45 -05:00
|
|
|
|
2020-12-02 16:19:16 -05:00
|
|
|
ImGui::Spacing();
|
|
|
|
if (ImGui::Button("Minimum##Wanted level", Ui::GetSize(3)))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
|
|
|
#ifdef GTASA
|
2021-06-18 12:49:11 -04:00
|
|
|
pPlayer->CheatWantedLevel(0);
|
2021-08-06 11:53:18 -04:00
|
|
|
#elif GTAVC
|
|
|
|
pPlayer->m_pWanted->CheatWantedLevel(0);
|
|
|
|
#endif
|
|
|
|
}
|
2020-12-02 16:19:16 -05:00
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
if (ImGui::Button("Default##Wanted level", Ui::GetSize(3)))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
|
|
|
#ifdef GTASA
|
2021-06-18 12:49:11 -04:00
|
|
|
pPlayer->CheatWantedLevel(0);
|
2021-08-06 11:53:18 -04:00
|
|
|
#elif GTAVC
|
|
|
|
pPlayer->m_pWanted->CheatWantedLevel(0);
|
|
|
|
#endif
|
|
|
|
}
|
2020-12-02 16:19:16 -05:00
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
if (ImGui::Button("Maximum##Wanted level", Ui::GetSize(3)))
|
2021-08-06 11:53:18 -04:00
|
|
|
{
|
|
|
|
#ifdef GTASA
|
2021-06-18 12:49:11 -04:00
|
|
|
pPlayer->CheatWantedLevel(max_wl);
|
2021-08-06 11:53:18 -04:00
|
|
|
#elif GTAVC
|
|
|
|
pPlayer->m_pWanted->CheatWantedLevel(max_wl);
|
|
|
|
#endif
|
|
|
|
}
|
2020-12-02 16:19:16 -05:00
|
|
|
|
|
|
|
ImGui::Spacing();
|
|
|
|
ImGui::Separator();
|
|
|
|
}
|
|
|
|
ImGui::EndChild();
|
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
#ifdef GTASA
|
2020-12-02 16:19:16 -05:00
|
|
|
if (ImGui::BeginTabItem("Appearance"))
|
|
|
|
{
|
|
|
|
ImGui::Spacing();
|
2021-08-06 11:53:18 -04:00
|
|
|
|
2021-06-18 12:49:11 -04:00
|
|
|
if (Ui::CheckboxWithHint("Aim skin changer", &m_bAimSkinChanger,
|
2021-08-06 11:53:18 -04:00
|
|
|
(("Changes to the ped, player is targeting with a weapon.\nTo use aim a ped with a weapon and press ")
|
|
|
|
+ Ui::GetHotKeyNameString(Menu::m_HotKeys::aimSkinChanger)).c_str()))
|
2021-06-18 12:49:11 -04:00
|
|
|
config.SetValue("aim_skin_changer", m_bAimSkinChanger);
|
2020-12-02 16:19:16 -05:00
|
|
|
if (ImGui::BeginTabBar("AppearanceTabBar"))
|
|
|
|
{
|
|
|
|
if (ImGui::BeginTabItem("Clothes"))
|
|
|
|
{
|
2021-07-30 18:01:17 -04:00
|
|
|
static int bClothOption = 0;
|
|
|
|
ImGui::RadioButton("Add", &bClothOption, 0);
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::RadioButton("Remove", &bClothOption, 1);
|
2020-12-02 16:19:16 -05:00
|
|
|
ImGui::Spacing();
|
|
|
|
|
2021-06-18 12:49:11 -04:00
|
|
|
if (pPlayer->m_nModelIndex == 0)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-07-30 18:01:17 -04:00
|
|
|
if (bClothOption == 0)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-08-13 13:45:56 -04:00
|
|
|
Ui::DrawImages(m_ClothData, ChangePlayerCloth, nullptr,
|
2021-08-06 11:53:18 -04:00
|
|
|
[](std::string str)
|
|
|
|
{
|
|
|
|
std::stringstream ss(str);
|
|
|
|
std::string temp;
|
2020-12-02 16:19:16 -05:00
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
getline(ss, temp, '$');
|
|
|
|
getline(ss, temp, '$');
|
2020-12-02 16:19:16 -05:00
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
return temp;
|
|
|
|
}, nullptr, cloth_category, sizeof(cloth_category) / sizeof(const char*));
|
2021-07-30 18:01:17 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
size_t count = 0;
|
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
if (ImGui::Button("Remove all", ImVec2(Ui::GetSize(2))))
|
2021-07-30 18:01:17 -04:00
|
|
|
{
|
|
|
|
CPlayerPed* player = FindPlayerPed();
|
|
|
|
for (uint i = 0; i < 18; i++)
|
|
|
|
{
|
|
|
|
player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(0u, 0u, i);
|
|
|
|
}
|
|
|
|
CClothes::RebuildPlayer(player, false);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
for (const char* clothName : cloth_category)
|
|
|
|
{
|
2021-08-06 11:53:18 -04:00
|
|
|
if (ImGui::Button(clothName, ImVec2(Ui::GetSize(2))))
|
2021-07-30 18:01:17 -04:00
|
|
|
{
|
|
|
|
CPlayerPed* player = FindPlayerPed();
|
|
|
|
player->m_pPlayerData->m_pPedClothesDesc->SetTextureAndModel(0u, 0u, count);
|
|
|
|
CClothes::RebuildPlayer(player, false);
|
|
|
|
}
|
|
|
|
|
2021-08-06 11:53:18 -04:00
|
|
|
if (count % 2 != 0)
|
2021-07-30 18:01:17 -04:00
|
|
|
{
|
|
|
|
ImGui::SameLine();
|
|
|
|
}
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::Spacing();
|
|
|
|
ImGui::TextWrapped("If CJ is wearing a full suit, click 'Extras/ Remove all' to remove it.");
|
|
|
|
}
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ImGui::TextWrapped("You need to be in CJ skin.");
|
|
|
|
ImGui::Spacing();
|
|
|
|
|
|
|
|
if (ImGui::Button("Change to CJ skin", ImVec2(Ui::GetSize(1))))
|
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
pPlayer->SetModelIndex(0);
|
|
|
|
Util::ClearCharTasksVehCheck(pPlayer);
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
|
|
|
if (ImGui::BeginTabItem("Ped skins"))
|
|
|
|
{
|
2021-08-13 13:45:56 -04:00
|
|
|
Ui::DrawImages(Ped::m_PedData, ChangePlayerModel, nullptr,
|
2021-08-12 23:28:19 -04:00
|
|
|
[](std::string str) { return Ped::m_PedData.m_pJson->m_Data[str].get<std::string>(); });
|
2020-12-02 16:19:16 -05:00
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
|
|
|
if (ImGui::BeginTabItem("Custom skins"))
|
|
|
|
{
|
|
|
|
ImGui::Spacing();
|
2021-02-24 16:54:45 -05:00
|
|
|
|
2021-06-18 12:49:11 -04:00
|
|
|
if (m_bModloaderInstalled)
|
2021-02-24 16:54:45 -05:00
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
Ui::FilterWithHint("Search", m_ClothData.m_Filter,
|
2021-08-06 11:53:18 -04:00
|
|
|
std::string("Total skins: " + std::to_string(m_CustomSkins::m_List.size()))
|
|
|
|
.c_str());
|
2021-02-08 05:25:06 -05:00
|
|
|
Ui::ShowTooltip("Place your dff & txd files inside 'modloader/Custom Skins'");
|
|
|
|
ImGui::Spacing();
|
2021-06-18 12:49:11 -04:00
|
|
|
ImGui::TextWrapped(
|
|
|
|
"Note: Your txd & dff names can't exceed 8 characters. Don't change names while the game is running.");
|
2021-02-08 05:25:06 -05:00
|
|
|
ImGui::Spacing();
|
2021-06-19 09:00:13 -04:00
|
|
|
for (std::string name : m_CustomSkins::m_List)
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-06-19 09:00:13 -04:00
|
|
|
if (m_CustomSkins::m_Filter.PassFilter(name.c_str()))
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
2021-02-24 16:54:45 -05:00
|
|
|
if (ImGui::MenuItem(name.c_str()))
|
2020-12-02 16:19:16 -05:00
|
|
|
{
|
|
|
|
ChangePlayerModel(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-06-18 12:49:11 -04:00
|
|
|
ImGui::TextWrapped(
|
|
|
|
"Custom skin allows to change player skins without replacing any existing game ped skins.\n\
|
2021-06-17 09:00:32 -04:00
|
|
|
Steps to enable 'Custom Skins',\n\n\
|
|
|
|
1. Download & install modloader\n\
|
|
|
|
2. Create a folder inside 'modloader' folder with the name 'Custom Skins'\n\
|
|
|
|
3. Download ped skins online ( .dff & .txd files) and put them inside.\n\
|
|
|
|
4. Restart your game.\n\n\n\
|
|
|
|
Limitations:\n\
|
|
|
|
1. Your .dff & .txd file names must not exceed 8 characters.\n\
|
|
|
|
2. Do not rename them while the game is running\n\
|
|
|
|
\nDoing so will crash your game.");
|
2020-12-02 16:19:16 -05:00
|
|
|
ImGui::Spacing();
|
|
|
|
if (ImGui::Button("Download Modloader", ImVec2(Ui::GetSize(1))))
|
2021-06-18 12:49:11 -04:00
|
|
|
ShellExecute(NULL, "open", "https://gtaforums.com/topic/669520-mod-loader/", NULL, NULL,
|
2021-08-06 11:53:18 -04:00
|
|
|
SW_SHOWNORMAL);
|
2020-12-02 16:19:16 -05:00
|
|
|
}
|
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
|
|
|
ImGui::EndTabBar();
|
|
|
|
}
|
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
2021-08-06 11:53:18 -04:00
|
|
|
#elif GTAVC
|
|
|
|
if (ImGui::BeginTabItem("Skins"))
|
|
|
|
{
|
|
|
|
ImGui::Spacing();
|
|
|
|
ImGui::Text("Info");
|
|
|
|
Ui::ShowTooltip("Not all ped skins work. I've added the ones that works!");
|
2021-08-07 12:01:44 -04:00
|
|
|
Ui::DrawJSON(skinData, ChangePlayerModel, nullptr);
|
2021-08-06 11:53:18 -04:00
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
|
|
|
#endif
|
2020-12-02 16:19:16 -05:00
|
|
|
ImGui::EndTabBar();
|
|
|
|
}
|
|
|
|
}
|