diff --git a/BigBaseV2/src/features/functions.cpp b/BigBaseV2/src/features/functions.cpp new file mode 100644 index 00000000..bbe43e46 --- /dev/null +++ b/BigBaseV2/src/features/functions.cpp @@ -0,0 +1,56 @@ +#include "functions.hpp" +#include "gta/levels.hpp" +#include "script_global.hpp" + +namespace big::features::functions +{ + void get_active_character_slot(int* statSlot) + { + STATS::STAT_GET_INT(RAGE_JOAAT("MPPLY_LAST_MP_CHAR"), statSlot, true); + } + + void join_session_type(session_type session) + { + features::notify::above_map(session.id == -1 ? "Leaving GTA Online." : "Joining specified session."); + + if (session.id == -1) + *script_global(1312443).at(2).as() = -1; + else + *script_global(1312854).as() = session.id; + + MISC::SET_BIT(&*script_global(1312443).as(), 1); + script::get_current()->yield(200ms); + MISC::SET_BIT(&*script_global(1312443).as(), 0); + } + + void reset_vehicle_sell_stats() + { + get_active_character_slot(&g_temp.character_slot); + + char stat_string[64]; + sprintf(stat_string, "MP%d_MONEY_EARN_SELLING_VEH", g_temp.character_slot); + + STATS::STAT_SET_INT(RAGE_JOAAT("MPPLY_VEHICLE_SELL_TIME"), 0, true); + STATS::STAT_SET_INT(MISC::GET_HASH_KEY(stat_string), 50000, true); + } + + void set_car_sell_value(int value) + { + *script_global(99007).at(970).as() = value; + } + + void set_player_level(int level) + { + get_active_character_slot(&g_temp.character_slot); + + char level_string[64]; + sprintf(level_string, "MP%d_CHAR_SET_RP_GIFT_ADMIN", g_temp.character_slot); + + STATS::STAT_SET_INT(MISC::GET_HASH_KEY(level_string), levels[level - 1], 0); + } + + void spoof_rank(int rank) + { + *script_global(1590682).at(PLAYER::PLAYER_ID(), 883).at(211).at(6).as() = rank; + } +} \ No newline at end of file diff --git a/BigBaseV2/src/features/functions.hpp b/BigBaseV2/src/features/functions.hpp new file mode 100644 index 00000000..9147002f --- /dev/null +++ b/BigBaseV2/src/features/functions.hpp @@ -0,0 +1,13 @@ +#pragma once +#include "features.hpp" +#include "gta/joaat.hpp" + +namespace big::features::functions +{ + void get_active_character_slot(int* statSlot); + void join_session_type(session_type session); + void reset_vehicle_sell_stats(); + void set_car_sell_value(int value); + void set_player_level(int level); + void spoof_rank(int rank); +} \ No newline at end of file