mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-23 09:02:38 +08:00
Reactions, remote kick and better protections (#807)
* feat(Scripts): Complete GlobalPlayerBD * feat(Scripts): add GPBD_Kicking * feat(Scripts): start work on GPBD_FM_3 * feat(Scripts): add more to GPBD_FM_3 * feat(Scripts): complete GPBD_FM_3 * feat(Scripts): start work on GPBD_FM * feat(Scripts): improve GPBD_FM * feat(Scripts): complete GPBD_FM * feat(Reactions): Add reactions * feat(Protections): Improve protections * feat(RemoteKick): Add remote kick * feat(Stats): add KillsOnPlayers and DeathsByPlayers * fix(Classes): Fix compiler warnings
This commit is contained in:
52
src/backend/looped/player/toxic_options.cpp
Normal file
52
src/backend/looped/player/toxic_options.cpp
Normal file
@ -0,0 +1,52 @@
|
||||
#include "gta/pickup_rewards.hpp"
|
||||
#include "backend/looped/looped.hpp"
|
||||
#include "services/players/player_service.hpp"
|
||||
#include "util/globals.hpp"
|
||||
#include "util/misc.hpp"
|
||||
#include "util/toxic.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void looped::player_toxic_options()
|
||||
{
|
||||
if (!*g_pointers->m_is_session_started)
|
||||
return;
|
||||
|
||||
int rotate_cam_bits = 0;
|
||||
|
||||
g_player_service->iterate([&rotate_cam_bits](const player_entry& entry)
|
||||
{
|
||||
if (g_player_service->get_self()->get_ped() && entry.second->get_ped() && entry.second->get_ped()->m_health > 0)
|
||||
{
|
||||
if (entry.second->kill_loop && !(entry.second->get_ped()->m_damage_bits & (1 << 8)))
|
||||
g_pointers->m_send_network_damage((CEntity*)g_player_service->get_self()->get_ped(), (CEntity*)entry.second->get_ped(), entry.second->get_ped()->m_navigation->get_position(),
|
||||
0, true, RAGE_JOAAT("weapon_explosion"), 10000.0f, 2, 0, (1 << 4), 0, 0, 0, false, false, true, true, nullptr);
|
||||
|
||||
if (entry.second->explosion_loop)
|
||||
toxic::blame_explode_player(entry.second, entry.second, EXP_TAG_SUBMARINE_BIG, 9999.0f, true, false, 9999.0f);
|
||||
|
||||
if (entry.second->freeze_loop)
|
||||
TASK::CLEAR_PED_TASKS_IMMEDIATELY(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(entry.second->id()));
|
||||
|
||||
if (entry.second->ragdoll_loop && entry.second->get_ped()->m_net_object)
|
||||
g_pointers->m_request_ragdoll(entry.second->get_ped()->m_net_object->m_object_id);
|
||||
|
||||
if (entry.second->rotate_cam_loop)
|
||||
rotate_cam_bits |= (1 << entry.second->id());
|
||||
}
|
||||
|
||||
if (rotate_cam_bits)
|
||||
{
|
||||
const size_t arg_count = 3;
|
||||
int64_t args[arg_count] =
|
||||
{
|
||||
(int64_t)eRemoteEvent::TSECommand,
|
||||
(int64_t)self::id,
|
||||
(int64_t)eRemoteEvent::TSECommandRotateCam
|
||||
};
|
||||
|
||||
g_pointers->m_trigger_script_event(1, args, arg_count, rotate_cam_bits);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user