This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/backend/looped/self/off_radar.cpp
2023-07-15 00:57:30 +02:00

33 lines
1.0 KiB
C++

#include "backend/looped_command.hpp"
#include "backend/bool_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
class off_radar : looped_command
{
using looped_command::looped_command;
virtual void on_tick() override
{
if (g.self.ghost_org)
MISC::SET_BIT(script_global(2794162).at(4667).as<int*>(), 2);
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].OffRadarActive = true;
*scr_globals::offradar_time.at(57).as<int*>() = NETWORK::GET_NETWORK_TIME() + 1;
}
virtual void on_disable() override
{
if (!g.self.ghost_org)
MISC::CLEAR_BIT(script_global(2794162).at(4667).as<int*>(), 2);
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].OffRadarActive = false;
}
};
off_radar g_off_radar("otr", "OFF_RADAR", "OFF_RADAR_DESC", g.self.off_radar);
bool_command ghost_org("ghostorg", "Ghost Org", "Use Ghost Organization instead of standard off radar.", g.self.ghost_org);
}