feat(): Moved several things to functions to clean up GUI code
This commit is contained in:
parent
d4aad765fd
commit
32cfba68c6
56
BigBaseV2/src/features/functions.cpp
Normal file
56
BigBaseV2/src/features/functions.cpp
Normal file
@ -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<int*>() = -1;
|
||||
else
|
||||
*script_global(1312854).as<int*>() = session.id;
|
||||
|
||||
MISC::SET_BIT(&*script_global(1312443).as<int*>(), 1);
|
||||
script::get_current()->yield(200ms);
|
||||
MISC::SET_BIT(&*script_global(1312443).as<int*>(), 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<int*>() = 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<int*>() = rank;
|
||||
}
|
||||
}
|
13
BigBaseV2/src/features/functions.hpp
Normal file
13
BigBaseV2/src/features/functions.hpp
Normal file
@ -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);
|
||||
}
|
Reference in New Issue
Block a user