mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-04 00:23:27 +08:00
feat(Features): Added god mode looped feature
This commit is contained in:
parent
0093aa4f19
commit
1f8b1f6c01
@ -8,6 +8,7 @@ namespace big
|
|||||||
{
|
{
|
||||||
void features::run_tick()
|
void features::run_tick()
|
||||||
{
|
{
|
||||||
|
god_mode();
|
||||||
}
|
}
|
||||||
|
|
||||||
void features::script_func()
|
void features::script_func()
|
||||||
|
@ -21,5 +21,7 @@ namespace big
|
|||||||
{
|
{
|
||||||
void run_tick();
|
void run_tick();
|
||||||
void script_func();
|
void script_func();
|
||||||
|
|
||||||
|
void god_mode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
22
BigBaseV2/src/features/god_mode.cpp
Normal file
22
BigBaseV2/src/features/god_mode.cpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#include "features.hpp"
|
||||||
|
#include "fiber_pool.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
static bool bLastGodMode = false;
|
||||||
|
|
||||||
|
void features::god_mode()
|
||||||
|
{
|
||||||
|
bool bGodMode = g_settings.options["god_mode"].get<bool>();
|
||||||
|
|
||||||
|
if (bGodMode || (!bGodMode && bGodMode != bLastGodMode))
|
||||||
|
{
|
||||||
|
QUEUE_JOB_BEGIN_CLAUSE(= )
|
||||||
|
{
|
||||||
|
ENTITY::SET_ENTITY_INVINCIBLE(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(PLAYER::PLAYER_ID()), bGodMode);
|
||||||
|
}QUEUE_JOB_END_CLAUSE
|
||||||
|
|
||||||
|
bLastGodMode = bGodMode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user