Update to 1.67 (#1407)

This commit is contained in:
maybegreat48
2023-06-14 21:29:25 +00:00
committed by GitHub
parent 131544e538
commit 0ff99ececc
43 changed files with 262 additions and 486 deletions

View File

@ -1,5 +1,6 @@
#include "core/scr_globals.hpp"
#include "script_local.hpp"
#include "services/tunables/tunables_service.hpp"
#include "util/math.hpp"
#include "util/scripts.hpp"
#include "util/teleport.hpp"
@ -7,7 +8,7 @@
namespace big
{
int get_land_mark_beast_is_closest_to(player_ptr player, script_local land_mark_list)
int get_land_mark_beast_is_closest_to(player_ptr player, script_local land_mark_list, int num_landmarks)
{
if (!player->get_ped() || !player->get_ped()->m_navigation)
return -1;
@ -18,7 +19,7 @@ namespace big
player->get_ped()->m_navigation->get_position()->z);
float distance = math::distance_between_vectors(transformed_vector, *land_mark_list.at(0, 3).as<Vector3*>());
for (int i = 1; i < *script_global(262145).at(11711).as<int*>(); i++)
for (int i = 1; i < num_landmarks; i++)
{
float new_distance = math::distance_between_vectors(transformed_vector, *land_mark_list.at(i, 3).as<Vector3*>());
if (new_distance < distance)
@ -46,22 +47,26 @@ namespace big
});
ImGui::Spacing();
auto beast_land_mark_list = script_local(hunt_the_beast_script_thread, 599).at(1).at(19);
auto beast_land_marks = *script_global(262145).at(11711).as<int*>();
auto beast_land_mark_list =
script_local(hunt_the_beast_script_thread, scr_locals::am_hunt_the_beast::broadcast_idx).at(1).at(19);
static int* num_landmarks = nullptr;
if (!num_landmarks)
num_landmarks = g_tunables_service->get_tunable<int*>(RAGE_JOAAT("HUNT_THE_BEAST_NUMBER_OF_ACTIVE_LANDMARKS"));
if (ImGui::ListBoxHeader("##beastlandmarks", ImVec2(400, 300)))
{
for (int i = 0; i < beast_land_marks; i++)
for (int i = 0; i < (num_landmarks ? *num_landmarks : 10); i++)
{
auto script_local_land_mark = *beast_land_mark_list.at(i, 3).as<Vector3*>();
std::string label = std::format("Tp to landmark {} at {} {} {}",
std::string label = std::format("TP To Landmark {} at {} {} {}",
i,
script_local_land_mark.x,
script_local_land_mark.y,
script_local_land_mark.z);
if (ImGui::Selectable(label.data(), i == get_land_mark_beast_is_closest_to(g_player_service->get_by_id(beast_player_index), beast_land_mark_list)))
if (ImGui::Selectable(label.data(), i == get_land_mark_beast_is_closest_to(g_player_service->get_by_id(beast_player_index), beast_land_mark_list, num_landmarks ? *num_landmarks : 10)))
g_fiber_pool->queue_job([script_local_land_mark, beast] {
teleport::teleport_player_to_coords(g.player.spectating ? beast : g_player_service->get_self(), script_local_land_mark);
});

View File

@ -3,11 +3,11 @@
#include "gta_util.hpp"
#include "script_local.hpp"
#include "util/scripts.hpp"
#include "views/view.hpp"
#include "views/network/missions/hunt_the_beast.hpp"
#include "views/network/missions/king_of_the_castle.hpp"
#include "views/network/missions/cp_collection.hpp"
#include "views/network/missions/criminal_damage.hpp"
#include "views/network/missions/hunt_the_beast.hpp"
#include "views/network/missions/king_of_the_castle.hpp"
#include "views/view.hpp"
namespace big
{
@ -72,16 +72,16 @@ namespace big
ImGui::BeginGroup();
components::button("One-On-One Deathmatch", [] {
scripts::start_launcher_script(197);
scripts::start_launcher_script(204);
});
components::button("Impromptu Race", [] {
scripts::start_launcher_script(16);
});
components::button("Flight School", [] {
scripts::start_launcher_script(196);
scripts::start_launcher_script(203);
});
components::button("Golf", [] {
scripts::start_launcher_script(193);
scripts::start_launcher_script(200);
});
components::button("Tutorial", [] {
scripts::start_launcher_script(20);
@ -94,19 +94,28 @@ namespace big
ImGui::BeginGroup();
components::button("Gunslinger", [] {
scripts::start_launcher_script(211);
scripts::start_launcher_script(218);
});
components::button("Space Monkey", [] {
scripts::start_launcher_script(216);
scripts::start_launcher_script(223);
});
components::button("Wizard", [] {
scripts::start_launcher_script(212);
scripts::start_launcher_script(219);
});
components::button("QUB3D", [] {
scripts::start_launcher_script(217);
scripts::start_launcher_script(224);
});
components::button("Camhedz", [] {
scripts::start_launcher_script(218);
scripts::start_launcher_script(225);
});
ImGui::EndGroup();
ImGui::BeginGroup();
components::button("Ghost Hunt", [] {
scripts::start_launcher_script(174);
});
components::button("Possesed Animals", [] {
scripts::start_launcher_script(179);
});
ImGui::EndGroup();
@ -121,7 +130,7 @@ namespace big
if (check_script(RAGE_JOAAT("am_king_of_the_castle")))
render_king_of_the_castle_ui();
if(check_script(RAGE_JOAAT("am_hunt_the_beast")))
if (check_script(RAGE_JOAAT("am_hunt_the_beast")))
render_hunt_the_beast_ui();
if (!mission_found)

View File

@ -13,6 +13,7 @@
#include <network/Network.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
@ -171,14 +172,14 @@ namespace big
if (ImGui::SliderInt("WANTED_LVL"_T.data(), &global_wanted_level, 0, 5))
{
*scr_globals::globalplayer_bd.at(self::id, scr_globals::size::globalplayer_bd).at(213).as<int*>() = global_wanted_level;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
ImGui::SameLine();
if (ImGui::Checkbox("FORCE"_T.data(), &g.session.wanted_level_all))
{
*scr_globals::globalplayer_bd.at(self::id, scr_globals::size::globalplayer_bd).at(212).as<Player*>() = __rdtsc() + 32;
*scr_globals::globalplayer_bd.at(self::id, scr_globals::size::globalplayer_bd).at(213).as<int*>() = global_wanted_level;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelPlayer = __rdtsc() + 32;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
components::command_button<"killall">({}, "KILL_ALL"_T);