diff --git a/BigBaseV2/src/util/toxic.hpp b/BigBaseV2/src/util/toxic.hpp index 599cfa47..b081929f 100644 --- a/BigBaseV2/src/util/toxic.hpp +++ b/BigBaseV2/src/util/toxic.hpp @@ -44,6 +44,20 @@ namespace big::toxic g_pointers->m_trigger_script_event(1, args, arg_count, -1); } + + inline void taze_player(const Player player) + { + const Ped target = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player); + + constexpr auto max_attempts = 20; + for (size_t attempts = 0; attempts < max_attempts && !ENTITY::IS_ENTITY_DEAD(target, false); attempts++) + { + const Vector3 destination = PED::GET_PED_BONE_COORDS(target, (int)PedBones::SKEL_ROOT, 0.0f, 0.0f, 0.0f); + const Vector3 origin = PED::GET_PED_BONE_COORDS(target, (int)PedBones::SKEL_R_Hand, 0.0f, 0.0f, 0.2f); + + MISC::SHOOT_SINGLE_BULLET_BETWEEN_COORDS(origin.x, origin.y, origin.z, destination.x, destination.y, destination.z, 1, 0, RAGE_JOAAT("WEAPON_STUNGUN"), PLAYER::PLAYER_PED_ID(), false, true, 1); + } + } inline void clear_wanted_player(Player target) { @@ -56,4 +70,4 @@ namespace big::toxic g_pointers->m_trigger_script_event(1, args, arg_count, 1 << target); } -} +} \ No newline at end of file diff --git a/BigBaseV2/src/views/view_player.cpp b/BigBaseV2/src/views/view_player.cpp index ff4ecf93..aa80feb2 100644 --- a/BigBaseV2/src/views/view_player.cpp +++ b/BigBaseV2/src/views/view_player.cpp @@ -121,10 +121,12 @@ namespace big g_player_service->get_selected()->id(), eExplosionType::PLANE, 1000, false, true, 0.f ); - }); - } + }); + components::button("Taze", [] { + toxic::taze_player(g_player_service->get_selected()->id()); + }); + } } - } } \ No newline at end of file