More weapon options & bug fixes
1. Fixed menu being unopenable when game speed increased 2. Improved sync system time 3. Fixed player model being broken when using ped model 4. Fixed car being spawned buried in some cases 5. Added more weapon options
This commit is contained in:
parent
bc754af853
commit
39c61520a1
@ -57,7 +57,8 @@ CheatMenu::CheatMenu()
|
|||||||
|
|
||||||
Events::processScriptsEvent += [this]
|
Events::processScriptsEvent += [this]
|
||||||
{
|
{
|
||||||
if (Globals::init_done && !FrontEndMenuManager.m_bMenuActive && CTimer::m_snTimeInMilliseconds - Globals::last_key_timer > 250)
|
if (Globals::init_done && !FrontEndMenuManager.m_bMenuActive
|
||||||
|
&& CTimer::m_snTimeInMilliseconds - Globals::last_key_timer > 250*CTimer::ms_fTimeScale)
|
||||||
{
|
{
|
||||||
if (Ui::HotKeyPressed(hotkey::menu_open))
|
if (Ui::HotKeyPressed(hotkey::menu_open))
|
||||||
{
|
{
|
||||||
|
30
src/Game.cpp
30
src/Game.cpp
@ -43,6 +43,25 @@ uint Game::solid_water_object = 0;
|
|||||||
|
|
||||||
CJson Game::random_cheats::name_json = CJson("cheat name");
|
CJson Game::random_cheats::name_json = CJson("cheat name");
|
||||||
|
|
||||||
|
// Thanks to aap
|
||||||
|
void RealTimeClock(void)
|
||||||
|
{
|
||||||
|
static int lastday;
|
||||||
|
time_t tmp = time(NULL);
|
||||||
|
struct tm *now = localtime(&tmp);
|
||||||
|
|
||||||
|
if(now->tm_yday != lastday)
|
||||||
|
CStats::SetStatValue(0x86, CStats::GetStatValue(0x86) + 1.0f);
|
||||||
|
|
||||||
|
lastday = now->tm_yday;
|
||||||
|
CClock::ms_nGameClockMonth = now->tm_mon+1;
|
||||||
|
CClock::ms_nGameClockDays = now->tm_mday;
|
||||||
|
CClock::CurrentDay = now->tm_wday+1;
|
||||||
|
CClock::ms_nGameClockHours = now->tm_hour;
|
||||||
|
CClock::ms_nGameClockMinutes = now->tm_min;
|
||||||
|
CClock::ms_nGameClockSeconds = now->tm_sec;
|
||||||
|
}
|
||||||
|
|
||||||
Game::Game()
|
Game::Game()
|
||||||
{
|
{
|
||||||
Events::initGameEvent += []
|
Events::initGameEvent += []
|
||||||
@ -294,7 +313,14 @@ of LS without completing missions"))
|
|||||||
solid_water_object = 0;
|
solid_water_object = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::Checkbox("Sync system time", &sync_time);
|
if (ImGui::Checkbox("Sync system time", &sync_time))
|
||||||
|
{
|
||||||
|
Globals::gsync_time = sync_time;
|
||||||
|
if (sync_time)
|
||||||
|
patch::RedirectCall(0x53BFBD, &RealTimeClock);
|
||||||
|
else
|
||||||
|
patch::RedirectCall(0x53BFBD, &CClock::Update);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Columns(1);
|
ImGui::Columns(1);
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
@ -342,7 +368,7 @@ of LS without completing missions"))
|
|||||||
}
|
}
|
||||||
Ui::EditAddress<int>("Days passed", 0xB79038, 0, 9999);
|
Ui::EditAddress<int>("Days passed", 0xB79038, 0, 9999);
|
||||||
Ui::EditReference("FPS limit", RsGlobal.frameLimit, 1, 30, 60);
|
Ui::EditReference("FPS limit", RsGlobal.frameLimit, 1, 30, 60);
|
||||||
Ui::EditReference("Game speed", CTimer::ms_fTimeScale,0, 1, 10);
|
Ui::EditReference("Game speed", CTimer::ms_fTimeScale,1, 1, 10);
|
||||||
Ui::EditFloat("Gravity", 0x863984, -1.0f, 0.008f, 1.0f);
|
Ui::EditFloat("Gravity", 0x863984, -1.0f, 0.008f, 1.0f);
|
||||||
|
|
||||||
if (ImGui::CollapsingHeader("Set time"))
|
if (ImGui::CollapsingHeader("Set time"))
|
||||||
|
@ -21,16 +21,20 @@ ImGuiTextFilter Player::custom_skins::filter = "";
|
|||||||
|
|
||||||
bool Player::modloader_installed = false;
|
bool Player::modloader_installed = false;
|
||||||
|
|
||||||
|
static void PlayerModelBrokenFix()
|
||||||
|
{
|
||||||
|
CPlayerPed *player = FindPlayerPed();
|
||||||
|
|
||||||
|
if (player->m_nModelIndex == 0)
|
||||||
|
Call<0x5A81E0>(0, player->m_pPlayerData->m_pPedClothesDesc,0xBC1C78,false);
|
||||||
|
}
|
||||||
|
|
||||||
Player::Player()
|
Player::Player()
|
||||||
{
|
{
|
||||||
Events::initGameEvent += []
|
Events::initGameEvent += []
|
||||||
{
|
{
|
||||||
/*
|
// Fix player model being broken after rebuild
|
||||||
Nop call to CClothes::RebuildPlayerIfNeeded
|
patch::RedirectCall(0x5A834D,&PlayerModelBrokenFix);
|
||||||
So player model doesn't get fked
|
|
||||||
This probably gonna fuck me up in future but oh well
|
|
||||||
*/
|
|
||||||
patch::Nop(0x44070A,5,false);
|
|
||||||
|
|
||||||
aim_skin_changer = config.GetValue("aim_skin_changer", false);
|
aim_skin_changer = config.GetValue("aim_skin_changer", false);
|
||||||
Util::LoadTexturesInDirRecursive(PLUGIN_PATH((char*)"CheatMenu\\clothes\\"), ".jpg", search_categories, clothes_vec);
|
Util::LoadTexturesInDirRecursive(PLUGIN_PATH((char*)"CheatMenu\\clothes\\"), ".jpg", search_categories, clothes_vec);
|
||||||
|
@ -69,14 +69,9 @@ Vehicle::Vehicle()
|
|||||||
{
|
{
|
||||||
Events::initGameEvent += []
|
Events::initGameEvent += []
|
||||||
{
|
{
|
||||||
std::string dir_path = std::string(Globals::menu_path + "\\CheatMenu\\vehicles\\images\\");
|
Util::LoadTexturesInDirRecursive(PLUGIN_PATH((char*)"CheatMenu\\vehicles\\images\\"), ".jpg", spawner::search_categories, spawner::image_vec);
|
||||||
Util::LoadTexturesInDirRecursive(dir_path.c_str(), ".jpg", spawner::search_categories, spawner::image_vec);
|
Util::LoadTexturesInDirRecursive(PLUGIN_PATH((char*)"CheatMenu\\vehicles\\components\\"), ".jpg", tune::search_categories, tune::image_vec);
|
||||||
|
Util::LoadTexturesInDirRecursive(PLUGIN_PATH((char*)"CheatMenu\\vehicles\\paintjobs\\"), ".png", texture9::search_categories, texture9::image_vec);
|
||||||
dir_path = std::string(Globals::menu_path + "\\CheatMenu\\vehicles\\components\\");
|
|
||||||
Util::LoadTexturesInDirRecursive(dir_path.c_str(), ".jpg", tune::search_categories, tune::image_vec);
|
|
||||||
|
|
||||||
dir_path = std::string(Globals::menu_path + "\\CheatMenu\\vehicles\\paintjobs\\");
|
|
||||||
Util::LoadTexturesInDirRecursive(dir_path.c_str(), ".png", texture9::search_categories, texture9::image_vec);
|
|
||||||
|
|
||||||
ParseVehiclesIDE();
|
ParseVehiclesIDE();
|
||||||
ParseCarcolsDAT();
|
ParseCarcolsDAT();
|
||||||
@ -492,7 +487,7 @@ void Vehicle::SpawnVehicle(std::string &smodel)
|
|||||||
int hveh = 0;
|
int hveh = 0;
|
||||||
if (spawner::spawn_inside)
|
if (spawner::spawn_inside)
|
||||||
{
|
{
|
||||||
Command<Commands::CREATE_CAR>(imodel, pos.x, pos.y, pos.z + 2.0f, &hveh);
|
Command<Commands::CREATE_CAR>(imodel, pos.x, pos.y, pos.z + 3.0f, &hveh);
|
||||||
veh = CPools::GetVehicle(hveh);
|
veh = CPools::GetVehicle(hveh);
|
||||||
veh->SetHeading(player->GetHeading());
|
veh->SetHeading(player->GetHeading());
|
||||||
Command<Commands::WARP_CHAR_INTO_CAR>(hplayer, hveh);
|
Command<Commands::WARP_CHAR_INTO_CAR>(hplayer, hveh);
|
||||||
@ -502,7 +497,7 @@ void Vehicle::SpawnVehicle(std::string &smodel)
|
|||||||
{
|
{
|
||||||
player->TransformFromObjectSpace(pos, CVector(0, 10, 0));
|
player->TransformFromObjectSpace(pos, CVector(0, 10, 0));
|
||||||
|
|
||||||
Command<Commands::CREATE_CAR>(imodel, pos.x, pos.y, pos.z + 2.0f, &hveh);
|
Command<Commands::CREATE_CAR>(imodel, pos.x, pos.y, pos.z + 3.0f, &hveh);
|
||||||
veh = CPools::GetVehicle(hveh);
|
veh = CPools::GetVehicle(hveh);
|
||||||
veh->SetHeading(player->GetHeading()+55.0f);
|
veh->SetHeading(player->GetHeading()+55.0f);
|
||||||
}
|
}
|
||||||
|
@ -252,19 +252,34 @@ void Visual::Main()
|
|||||||
int hour = CClock::ms_nGameClockHours;
|
int hour = CClock::ms_nGameClockHours;
|
||||||
int minute = CClock::ms_nGameClockMinutes;
|
int minute = CClock::ms_nGameClockMinutes;
|
||||||
|
|
||||||
if (ImGui::InputInt("Hour", &hour))
|
if (Globals::gsync_time)
|
||||||
|
{
|
||||||
|
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
|
||||||
|
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (ImGui::InputInt("Hour", &hour) & !Globals::gsync_time)
|
||||||
{
|
{
|
||||||
if (hour < 0) hour = 23;
|
if (hour < 0) hour = 23;
|
||||||
if (hour > 23) hour = 0;
|
if (hour > 23) hour = 0;
|
||||||
CClock::ms_nGameClockHours = hour;
|
CClock::ms_nGameClockHours = hour;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::InputInt("Minute", &minute))
|
if (ImGui::InputInt("Minute", &minute) & !Globals::gsync_time)
|
||||||
{
|
{
|
||||||
if (minute < 0) minute = 59;
|
if (minute < 0) minute = 59;
|
||||||
if (minute > 59) minute = 0;
|
if (minute > 59) minute = 0;
|
||||||
CClock::ms_nGameClockMinutes = minute;
|
CClock::ms_nGameClockMinutes = minute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Globals::gsync_time)
|
||||||
|
{
|
||||||
|
ImGui::PopStyleVar();
|
||||||
|
ImGui::PopItemFlag();
|
||||||
|
Ui::ShowTooltip("Sync system time is enabled.\n(Game/Sync system time)");
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
if (ImGui::BeginTabBar("Timecyc subtab", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll))
|
if (ImGui::BeginTabBar("Timecyc subtab", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll))
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,11 @@ bool Weapon::auto_aim = false;
|
|||||||
bool Weapon::fast_reload = false;
|
bool Weapon::fast_reload = false;
|
||||||
bool Weapon::huge_damage = false;
|
bool Weapon::huge_damage = false;
|
||||||
bool Weapon::long_range = false;
|
bool Weapon::long_range = false;
|
||||||
|
bool Weapon::rapid_fire = false;
|
||||||
|
bool Weapon::dual_weild = false;
|
||||||
|
bool Weapon::move_aim = false;
|
||||||
|
bool Weapon::move_fire = false;
|
||||||
|
|
||||||
uchar Weapon::cur_weapon_slot = -1;
|
uchar Weapon::cur_weapon_slot = -1;
|
||||||
int Weapon::ammo_count = 99999;
|
int Weapon::ammo_count = 99999;
|
||||||
|
|
||||||
@ -35,8 +40,7 @@ Weapon::Weapon()
|
|||||||
{
|
{
|
||||||
Events::initGameEvent += []
|
Events::initGameEvent += []
|
||||||
{
|
{
|
||||||
std::string dir_path = Globals::menu_path + "\\CheatMenu\\weapons\\";
|
Util::LoadTexturesInDirRecursive(PLUGIN_PATH((char*)"CheatMenu\\weapons\\"), ".jpg", Weapon::search_categories, Weapon::weapon_vec);
|
||||||
Util::LoadTexturesInDirRecursive(dir_path.c_str(), ".jpg", Weapon::search_categories, Weapon::weapon_vec);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Events::processScriptsEvent += []
|
Events::processScriptsEvent += []
|
||||||
@ -44,9 +48,7 @@ Weapon::Weapon()
|
|||||||
CPlayerPed *player = FindPlayerPed();
|
CPlayerPed *player = FindPlayerPed();
|
||||||
if (auto_aim)
|
if (auto_aim)
|
||||||
{
|
{
|
||||||
float mouseX, mouseY;
|
if (CPad::NewMouseControllerState.X == 0 && CPad::NewMouseControllerState.Y == 0)
|
||||||
Command<Commands::GET_PC_MOUSE_MOVEMENT>(&mouseX, &mouseY);
|
|
||||||
if (static_cast<int>(mouseY/2) == 0 || static_cast<int>(mouseX/2) == 0)
|
|
||||||
{
|
{
|
||||||
if (KeyPressed(2))
|
if (KeyPressed(2))
|
||||||
CCamera::m_bUseMouse3rdPerson = false;
|
CCamera::m_bUseMouse3rdPerson = false;
|
||||||
@ -62,15 +64,28 @@ Weapon::Weapon()
|
|||||||
CWeaponInfo *pweapon_info = CWeaponInfo::GetWeaponInfo(weapon_type, player->GetWeaponSkill(weapon_type));
|
CWeaponInfo *pweapon_info = CWeaponInfo::GetWeaponInfo(weapon_type, player->GetWeaponSkill(weapon_type));
|
||||||
|
|
||||||
if (huge_damage)
|
if (huge_damage)
|
||||||
pweapon_info->m_nDamage = 1000;
|
pweapon_info->m_nDamage = 5000;
|
||||||
|
|
||||||
if (long_range)
|
if (long_range)
|
||||||
{
|
{
|
||||||
pweapon_info->m_fTargetRange = 1000.0f;
|
pweapon_info->m_fTargetRange = 1000.0f;
|
||||||
pweapon_info->m_fWeaponRange = 1000.0f;
|
pweapon_info->m_fWeaponRange = 1000.0f;
|
||||||
pweapon_info->m_fAccuracy = 1.0f;
|
pweapon_info->m_fAccuracy = 1.0f;
|
||||||
|
pweapon_info->m_nFlags.bReload2Start = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rapid_fire)
|
||||||
|
pweapon_info->m_nFlags.bContinuosFire = true;
|
||||||
|
|
||||||
|
if (dual_weild && (weapon_type == WEAPON_PISTOL || weapon_type == WEAPON_MICRO_UZI || weapon_type == WEAPON_TEC9 || weapon_type == WEAPON_SAWNOFF))
|
||||||
|
pweapon_info->m_nFlags.bTwinPistol = true;
|
||||||
|
|
||||||
|
if (move_aim)
|
||||||
|
pweapon_info->m_nFlags.bMoveAim = true;
|
||||||
|
|
||||||
|
if (move_fire)
|
||||||
|
pweapon_info->m_nFlags.bMoveFire = true;
|
||||||
|
|
||||||
cur_weapon_slot = slot;
|
cur_weapon_slot = slot;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -150,6 +165,11 @@ void Weapon::Main()
|
|||||||
ImGui::Columns(2, 0, false);
|
ImGui::Columns(2, 0, false);
|
||||||
|
|
||||||
Ui::CheckboxWithHint("Auto aim", &auto_aim, "Enables aim assist on keyboard\n\nQ = left E = right");
|
Ui::CheckboxWithHint("Auto aim", &auto_aim, "Enables aim assist on keyboard\n\nQ = left E = right");
|
||||||
|
if (Ui::CheckboxWithHint("Dual weild", &dual_weild,"Dual weild pistol, shawoff, uzi, tec9\n(Other weapons don't work)"))
|
||||||
|
{
|
||||||
|
if (!dual_weild)
|
||||||
|
CWeaponInfo::LoadWeaponData();
|
||||||
|
}
|
||||||
if (Ui::CheckboxWithHint("Huge damage", &huge_damage))
|
if (Ui::CheckboxWithHint("Huge damage", &huge_damage))
|
||||||
{
|
{
|
||||||
if (!huge_damage)
|
if (!huge_damage)
|
||||||
@ -158,13 +178,30 @@ void Weapon::Main()
|
|||||||
if (Ui::CheckboxWithHint("Fast reload", &fast_reload))
|
if (Ui::CheckboxWithHint("Fast reload", &fast_reload))
|
||||||
Command<Commands::SET_PLAYER_FAST_RELOAD>(hplayer, fast_reload);
|
Command<Commands::SET_PLAYER_FAST_RELOAD>(hplayer, fast_reload);
|
||||||
|
|
||||||
ImGui::NextColumn();
|
|
||||||
Ui::CheckboxAddress("Infinite ammo", 0x969178);
|
Ui::CheckboxAddress("Infinite ammo", 0x969178);
|
||||||
|
|
||||||
|
ImGui::NextColumn();
|
||||||
|
|
||||||
if (Ui::CheckboxWithHint("Long range", &long_range))
|
if (Ui::CheckboxWithHint("Long range", &long_range))
|
||||||
{
|
{
|
||||||
if (!long_range)
|
if (!long_range)
|
||||||
CWeaponInfo::LoadWeaponData();
|
CWeaponInfo::LoadWeaponData();
|
||||||
}
|
}
|
||||||
|
if (Ui::CheckboxWithHint("Move when aiming", &move_aim))
|
||||||
|
{
|
||||||
|
if (!move_aim)
|
||||||
|
CWeaponInfo::LoadWeaponData();
|
||||||
|
}
|
||||||
|
if (Ui::CheckboxWithHint("Move when firing", &move_fire))
|
||||||
|
{
|
||||||
|
if (!move_fire)
|
||||||
|
CWeaponInfo::LoadWeaponData();
|
||||||
|
}
|
||||||
|
if (Ui::CheckboxWithHint("Rapid fire", &rapid_fire))
|
||||||
|
{
|
||||||
|
if (!rapid_fire)
|
||||||
|
CWeaponInfo::LoadWeaponData();
|
||||||
|
}
|
||||||
ImGui::Columns(1, 0, false);
|
ImGui::Columns(1, 0, false);
|
||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
|
@ -14,6 +14,10 @@ private:
|
|||||||
static bool fast_reload;
|
static bool fast_reload;
|
||||||
static bool huge_damage;
|
static bool huge_damage;
|
||||||
static bool long_range;
|
static bool long_range;
|
||||||
|
static bool rapid_fire;
|
||||||
|
static bool dual_weild;
|
||||||
|
static bool move_aim;
|
||||||
|
static bool move_fire;
|
||||||
|
|
||||||
static int ammo_count;
|
static int ammo_count;
|
||||||
static uchar cur_weapon_slot;
|
static uchar cur_weapon_slot;
|
||||||
|
@ -10,6 +10,7 @@ bool Globals::init_done = false;
|
|||||||
Renderer Globals::renderer = Render_Unknown;
|
Renderer Globals::renderer = Render_Unknown;
|
||||||
ID3D11Device *Globals::device11 = nullptr;
|
ID3D11Device *Globals::device11 = nullptr;
|
||||||
std::string Globals::menu_path = paths::GetPluginDirPathA();
|
std::string Globals::menu_path = paths::GetPluginDirPathA();
|
||||||
|
bool Globals::gsync_time = false;
|
||||||
|
|
||||||
std::ofstream flog = std::ofstream("CheatMenu.log");
|
std::ofstream flog = std::ofstream("CheatMenu.log");
|
||||||
CJson config = CJson("config");
|
CJson config = CJson("config");
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include "extensions\Paths.h"
|
#include "extensions\Paths.h"
|
||||||
|
|
||||||
#include "external/imgui/imgui.h"
|
#include "external/imgui/imgui.h"
|
||||||
|
#include "external/imgui/imgui_internal.h"
|
||||||
#include "external/imgui/imgui_impl_dx9.h"
|
#include "external/imgui/imgui_impl_dx9.h"
|
||||||
#include "external/imgui/imgui_impl_dx11.h"
|
#include "external/imgui/imgui_impl_dx11.h"
|
||||||
#include "external/imgui/imgui_impl_win32.h"
|
#include "external/imgui/imgui_impl_win32.h"
|
||||||
@ -90,6 +91,7 @@ struct Globals
|
|||||||
static Renderer renderer;
|
static Renderer renderer;
|
||||||
static ID3D11Device* device11;
|
static ID3D11Device* device11;
|
||||||
static std::string menu_path;
|
static std::string menu_path;
|
||||||
|
static bool gsync_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TextureStructure
|
struct TextureStructure
|
||||||
|
Loading…
Reference in New Issue
Block a user