mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-24 01:22:23 +08:00
feat(Recovery): Push more code related to setting char level
This commit is contained in:
202
BigBaseV2/src/core/data/levels.hpp
Normal file
202
BigBaseV2/src/core/data/levels.hpp
Normal file
File diff suppressed because one or more lines are too long
@ -11,6 +11,8 @@ struct globals {
|
|||||||
nlohmann::json options;
|
nlohmann::json options;
|
||||||
|
|
||||||
struct player {
|
struct player {
|
||||||
|
int character_slot = 1;
|
||||||
|
int set_level = 130;
|
||||||
bool spectating = false;
|
bool spectating = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
29
BigBaseV2/src/util/player.hpp
Normal file
29
BigBaseV2/src/util/player.hpp
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user