wip(Stats/Features): Pushing progress for stats & join message
This commit is contained in:
parent
8df0c5bac9
commit
db7e37f2a5
@ -13,6 +13,7 @@ namespace big
|
|||||||
update_screen_sizes();
|
update_screen_sizes();
|
||||||
|
|
||||||
god_mode();
|
god_mode();
|
||||||
|
join_message();
|
||||||
never_wanted();
|
never_wanted();
|
||||||
no_bike_fall();
|
no_bike_fall();
|
||||||
no_idle_kick();
|
no_idle_kick();
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "structs/player.hpp"
|
#include "structs/player.hpp"
|
||||||
#include "structs/temp.hpp"
|
#include "structs/temp.hpp"
|
||||||
#include "features/notify.hpp"
|
#include "features/notify.hpp"
|
||||||
|
#include "features/stats.hpp"
|
||||||
#include "features/teleport.hpp"
|
#include "features/teleport.hpp"
|
||||||
|
|
||||||
namespace big
|
namespace big
|
||||||
@ -24,6 +25,7 @@ namespace big
|
|||||||
void script_func();
|
void script_func();
|
||||||
|
|
||||||
void god_mode();
|
void god_mode();
|
||||||
|
void join_message();
|
||||||
void never_wanted();
|
void never_wanted();
|
||||||
void no_bike_fall();
|
void no_bike_fall();
|
||||||
void no_idle_kick();
|
void no_idle_kick();
|
||||||
|
22
BigBaseV2/src/features/join_message.cpp
Normal file
22
BigBaseV2/src/features/join_message.cpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#include "features.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
void features::join_message()
|
||||||
|
{
|
||||||
|
bool bJoinMessage = g_settings.options["join_message"].get<bool>();
|
||||||
|
|
||||||
|
if (bJoinMessage)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 32; i++) {
|
||||||
|
if (!g_players[i].is_online && ENTITY::DOES_ENTITY_EXIST(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(i))) {
|
||||||
|
char joinMsg[64];
|
||||||
|
strcpy(joinMsg, g_players[i].name);
|
||||||
|
strcat(joinMsg, "is joining");
|
||||||
|
|
||||||
|
features::notify::above_map(joinMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,17 @@
|
|||||||
#include "stats.hpp"
|
#include "stats.hpp"
|
||||||
|
#include "script.hpp"
|
||||||
|
|
||||||
namespace big::features
|
namespace big::features
|
||||||
{
|
{
|
||||||
|
void stats::unlock_achievements()
|
||||||
|
{
|
||||||
|
for (int i = 1; i < 100; i++) {
|
||||||
|
PLAYER::GIVE_ACHIEVEMENT_TO_PLAYER(i);
|
||||||
|
|
||||||
|
script::get_current()->yield();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void stats::unlock_all()
|
void stats::unlock_all()
|
||||||
{
|
{
|
||||||
QUEUE_JOB_BEGIN_CLAUSE()
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
@ -228,6 +238,8 @@ namespace big::features
|
|||||||
strcat(str, tmp);
|
strcat(str, tmp);
|
||||||
Hash hashs = MISC::GET_HASH_KEY(str);
|
Hash hashs = MISC::GET_HASH_KEY(str);
|
||||||
STATS::STAT_SET_INT(hashs, -1, 1);
|
STATS::STAT_SET_INT(hashs, -1, 1);
|
||||||
|
|
||||||
|
script::get_current()->yield();
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 140; i++)
|
for (int i = 0; i < 140; i++)
|
||||||
{
|
{
|
||||||
@ -245,6 +257,8 @@ namespace big::features
|
|||||||
strcat(str, tmp);
|
strcat(str, tmp);
|
||||||
Hash hashs = MISC::GET_HASH_KEY(str);
|
Hash hashs = MISC::GET_HASH_KEY(str);
|
||||||
STATS::STAT_SET_INT(hashs, -1, 1);
|
STATS::STAT_SET_INT(hashs, -1, 1);
|
||||||
|
|
||||||
|
script::get_current()->yield();
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 26; i++)
|
for (int i = 0; i < 26; i++)
|
||||||
{
|
{
|
||||||
@ -263,6 +277,8 @@ namespace big::features
|
|||||||
strcat(str, tmp);
|
strcat(str, tmp);
|
||||||
Hash hashs = MISC::GET_HASH_KEY(str);
|
Hash hashs = MISC::GET_HASH_KEY(str);
|
||||||
STATS::STAT_SET_INT(hashs, -1, 1);
|
STATS::STAT_SET_INT(hashs, -1, 1);
|
||||||
|
|
||||||
|
script::get_current()->yield();
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 38; i++)
|
for (int i = 0; i < 38; i++)
|
||||||
{
|
{
|
||||||
@ -280,6 +296,8 @@ namespace big::features
|
|||||||
strcat(str, tmp);
|
strcat(str, tmp);
|
||||||
Hash hashs = MISC::GET_HASH_KEY(str);
|
Hash hashs = MISC::GET_HASH_KEY(str);
|
||||||
STATS::STAT_SET_INT(hashs, -1, 1);
|
STATS::STAT_SET_INT(hashs, -1, 1);
|
||||||
|
|
||||||
|
script::get_current()->yield();
|
||||||
}
|
}
|
||||||
STATS::STAT_SET_INT(MISC::GET_HASH_KEY("MP1_SCRIPT_INCREASE_STAM"), 100, 1);
|
STATS::STAT_SET_INT(MISC::GET_HASH_KEY("MP1_SCRIPT_INCREASE_STAM"), 100, 1);
|
||||||
STATS::STAT_SET_INT(MISC::GET_HASH_KEY("MP1_SCRIPT_INCREASE_STRN"), 100, 1);
|
STATS::STAT_SET_INT(MISC::GET_HASH_KEY("MP1_SCRIPT_INCREASE_STRN"), 100, 1);
|
||||||
|
@ -8,6 +8,7 @@ namespace big::features
|
|||||||
class stats
|
class stats
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static void unlock_achievements();
|
||||||
static void unlock_all();
|
static void unlock_all();
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -15,6 +15,7 @@ namespace big
|
|||||||
tabbar::render_teleport();
|
tabbar::render_teleport();
|
||||||
tabbar::render_vehicle();
|
tabbar::render_vehicle();
|
||||||
tabbar::render_network();
|
tabbar::render_network();
|
||||||
|
tabbar::render_misc();
|
||||||
tabbar::render_spawn();
|
tabbar::render_spawn();
|
||||||
ImGui::EndTabBar();
|
ImGui::EndTabBar();
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ namespace big
|
|||||||
static void render_teleport();
|
static void render_teleport();
|
||||||
static void render_vehicle();
|
static void render_vehicle();
|
||||||
static void render_network();
|
static void render_network();
|
||||||
|
static void render_misc();
|
||||||
static void render_spawn();
|
static void render_spawn();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
33
BigBaseV2/src/gui/tab_bar/tab_misc.cpp
Normal file
33
BigBaseV2/src/gui/tab_bar/tab_misc.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#include "tab_bar.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
void tabbar::render_misc()
|
||||||
|
{
|
||||||
|
if (ImGui::BeginTabItem("Misc"))
|
||||||
|
{
|
||||||
|
if (ImGui::Checkbox("Player Join Message", g_settings.options["join_message"].get<bool*>()))
|
||||||
|
g_settings.save();
|
||||||
|
|
||||||
|
ImGui::Separator();
|
||||||
|
|
||||||
|
if (ImGui::Button("Unlock Achievements"))
|
||||||
|
{
|
||||||
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
|
{
|
||||||
|
features::stats::unlock_achievements();
|
||||||
|
}QUEUE_JOB_END_CLAUSE
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::Button("Unlock All Stats"))
|
||||||
|
{
|
||||||
|
QUEUE_JOB_BEGIN_CLAUSE()
|
||||||
|
{
|
||||||
|
features::stats::unlock_all();
|
||||||
|
}QUEUE_JOB_END_CLAUSE
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -14,6 +14,7 @@ namespace big
|
|||||||
nlohmann::json default_options =
|
nlohmann::json default_options =
|
||||||
R"({
|
R"({
|
||||||
"god_mode": false,
|
"god_mode": false,
|
||||||
|
"join_message": false,
|
||||||
"never_wanted": false,
|
"never_wanted": false,
|
||||||
"no_bike_fall": false,
|
"no_bike_fall": false,
|
||||||
"no_idle_kick": false,
|
"no_idle_kick": false,
|
||||||
|
Reference in New Issue
Block a user