feat(Recovery): Push more code related to setting char level

This commit is contained in:
Yimura 2021-07-23 12:28:17 +02:00
parent a090a33106
commit 46d79caa7b
3 changed files with 233 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,8 @@ struct globals {
nlohmann::json options;
struct player {
int character_slot = 1;
int set_level = 130;
bool spectating = false;
};

View File

@ -0,0 +1,29 @@
#pragma once
#include "core/data/levels.hpp"
#include "gta/joaat.hpp"
#include "natives.hpp"
#include "script_global.hpp"
namespace big::player
{
inline void easy_way_out()
{
*script_global(262145 + 27907).as<int*>() = 0;
*script_global(262145 + 27908).as<int*>() = 0;
}
inline void get_active_character_slot(int *character_slot)
{
STATS::STAT_GET_INT(RAGE_JOAAT("MPPLY_LAST_MP_CHAR"), character_slot, true);
}
inline void set_player_level(int level)
{
get_active_character_slot(&g.player.character_slot);
char level_string[64];
sprintf(level_string, "MP%d_CHAR_SET_RP_GIFT_ADMIN", g.player.character_slot);
STATS::STAT_SET_INT(rage::joaat(level_string), levels[level - 1], 0);
}
}