2022-01-21 23:13:43 +01:00
|
|
|
#pragma once
|
2022-12-19 17:39:06 +00:00
|
|
|
#include "script_function.hpp"
|
2022-01-21 23:13:43 +01:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
namespace freemode
|
|
|
|
{
|
2022-01-25 02:52:04 +01:00
|
|
|
inline void NETWORK_BAIL(rage::scrNativeCallContext* src)
|
2022-01-21 23:13:43 +01:00
|
|
|
{
|
2022-01-25 02:52:04 +01:00
|
|
|
LOG(INFO) << "NETWORK_BAIL prevented";
|
2022-01-21 23:13:43 +01:00
|
|
|
}
|
2022-11-12 18:35:28 +00:00
|
|
|
|
|
|
|
inline void IS_PLAYER_PLAYING(rage::scrNativeCallContext* src)
|
|
|
|
{
|
|
|
|
// block undead OTR
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.session.decloak_players && src->get_arg<Player>(0) != self::id)
|
2022-11-12 18:35:28 +00:00
|
|
|
src->set_return_value<BOOL>(TRUE);
|
|
|
|
else
|
|
|
|
src->set_return_value<BOOL>(PLAYER::IS_PLAYER_PLAYING(src->get_arg<Player>(0)));
|
|
|
|
};
|
2022-11-21 15:42:12 +00:00
|
|
|
|
|
|
|
inline void SET_ENTITY_VISIBLE(rage::scrNativeCallContext* src)
|
|
|
|
{
|
|
|
|
auto entity = src->get_arg<Entity>(0);
|
|
|
|
auto toggle = src->get_arg<bool>(1);
|
|
|
|
auto outfit = src->get_arg<bool>(2);
|
|
|
|
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.self.invisibility && entity == self::ped && toggle)
|
2022-11-21 15:42:12 +00:00
|
|
|
return;
|
|
|
|
else
|
|
|
|
ENTITY::SET_ENTITY_VISIBLE(entity, toggle, outfit);
|
|
|
|
}
|
2022-12-06 16:12:02 +00:00
|
|
|
|
|
|
|
void SET_BIGMAP_ACTIVE(rage::scrNativeCallContext* src)
|
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
if (!g.m_mission_creator_thread)
|
2022-12-06 16:12:02 +00:00
|
|
|
HUD::SET_BIGMAP_ACTIVE(src->get_arg<BOOL>(0), src->get_arg<BOOL>(1));
|
|
|
|
};
|
|
|
|
|
|
|
|
void SET_BLIP_DISPLAY(rage::scrNativeCallContext* src)
|
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
if ((!g.m_mission_creator_thread) || src->get_arg<Blip>(0) != HUD::GET_MAIN_PLAYER_BLIP_ID())
|
2022-12-06 16:12:02 +00:00
|
|
|
HUD::SET_BLIP_DISPLAY(src->get_arg<Blip>(0), src->get_arg<BOOL>(1));
|
|
|
|
};
|
2022-12-17 14:47:01 +00:00
|
|
|
|
|
|
|
void NETWORK_HAS_RECEIVED_HOST_BROADCAST_DATA(rage::scrNativeCallContext* src)
|
|
|
|
{
|
2022-12-18 23:15:52 +01:00
|
|
|
if (SCRIPT::GET_HASH_OF_THIS_SCRIPT_NAME() == RAGE_JOAAT("freemode") && g.session.force_script_host)
|
2022-12-17 14:47:01 +00:00
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([]
|
|
|
|
{
|
|
|
|
scripts::force_host(RAGE_JOAAT("freemode"));
|
|
|
|
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("freemode")); script && script->m_net_component)
|
|
|
|
script->m_net_component->block_host_migration(true);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-01-22 21:57:32 +00:00
|
|
|
if (SCRIPT::GET_HASH_OF_THIS_SCRIPT_NAME() == RAGE_JOAAT("fmmc_launcher") && g.session.force_script_host)
|
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([]
|
|
|
|
{
|
|
|
|
scripts::force_host(RAGE_JOAAT("fmmc_launcher"));
|
|
|
|
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("fmmc_launcher")); script && script->m_net_component)
|
|
|
|
script->m_net_component->block_host_migration(true);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-12-19 17:39:06 +00:00
|
|
|
scr_functions::set_freemode_session_active({});
|
2022-12-17 14:47:01 +00:00
|
|
|
src->set_return_value<BOOL>(TRUE);
|
|
|
|
}
|
2022-01-21 23:13:43 +01:00
|
|
|
}
|
|
|
|
}
|