diff --git a/docs/lua/commands.md b/docs/lua/commands.md index fa5ef8d0..395c3760 100644 --- a/docs/lua/commands.md +++ b/docs/lua/commands.md @@ -11,15 +11,7 @@ command.call_player(somePlayerIndex, "spawn", {joaat("adder")}) For a complete list of available command functions, please refer to the command table documentation. -## Command Count: 213 - -### bailkick - BAIL_KICK_DESC -Arg Count: 1 - -### bailkickall - BAIL_KICK_DESC -Arg Count: 0 +## Command Count: 212 ### breakup BREAKUP_KICK_DESC @@ -61,6 +53,10 @@ Arg Count: 1 SCRIPT_HOST_KICK_DESC Arg Count: 1 +### multikick + MULTI_KICK_DESC +Arg Count: 1 + ### clearwanted CLEAR_WANTED_LEVEL_DESC Arg Count: 1 diff --git a/src/backend/commands/player/kick/multi_kick.cpp b/src/backend/commands/player/kick/multi_kick.cpp new file mode 100644 index 00000000..cdcdddf9 --- /dev/null +++ b/src/backend/commands/player/kick/multi_kick.cpp @@ -0,0 +1,38 @@ +#include "backend/player_command.hpp" +#include "core/scr_globals.hpp" +#include "natives.hpp" +#include "pointers.hpp" +#include "script.hpp" + +namespace big +{ + class multi_kick : player_command + { + using player_command::player_command; + + virtual CommandAccessLevel get_access_level() override + { + return CommandAccessLevel::TOXIC; + } + + virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr ctx) override + { + dynamic_cast(command::get(RAGE_JOAAT("nfkick")))->call(player, {}); + dynamic_cast(command::get(RAGE_JOAAT("oomkick")))->call(player, {}); + dynamic_cast(command::get(RAGE_JOAAT("endkick")))->call(player, {}); + script::get_current()->yield(700ms); + + if (g_player_service->get_self()->is_host()) + dynamic_cast(command::get(RAGE_JOAAT("hostkick")))->call(player, {}); + + if (!player->is_host() && !g_player_service->get_self()->is_host()) + dynamic_cast(command::get(RAGE_JOAAT("desync")))->call(player, {}); + + if (g_player_service->get_self()->is_host()) + dynamic_cast(command::get(RAGE_JOAAT("breakup")))->call(player, {}), + NETWORK::NETWORK_SESSION_KICK_PLAYER(player->id()); + } + }; + + multi_kick g_multi_kick("multikick", "MULTI_KICK", "MULTI_KICK_DESC", 0, false); +} diff --git a/src/backend/looped/session/auto_kick_host.cpp b/src/backend/looped/session/auto_kick_host.cpp index 8911077f..fbe98ad2 100644 --- a/src/backend/looped/session/auto_kick_host.cpp +++ b/src/backend/looped/session/auto_kick_host.cpp @@ -14,9 +14,7 @@ namespace big g_player_service->iterate([](auto& plyr) { if (plyr.second->is_host()) { - dynamic_cast(command::get(RAGE_JOAAT("bailkick")))->call(plyr.second, {}); - dynamic_cast(command::get(RAGE_JOAAT("nfkick")))->call(plyr.second, {}); - //dynamic_cast(command::get(RAGE_JOAAT("breakup")))->call(plyr.second, {}); + dynamic_cast(command::get(RAGE_JOAAT("multikick")))->call(plyr.second, {}); } }); } diff --git a/src/backend/reactions/reaction.cpp b/src/backend/reactions/reaction.cpp index 0b4916d5..13f8992d 100644 --- a/src/backend/reactions/reaction.cpp +++ b/src/backend/reactions/reaction.cpp @@ -40,12 +40,7 @@ namespace big { g_fiber_pool->queue_job([player] { - dynamic_cast(command::get(RAGE_JOAAT("bailkick")))->call(player, {}); - dynamic_cast(command::get(RAGE_JOAAT("nfkick")))->call(player, {}); - script::get_current()->yield(700ms); - if(g_player_service->get_self()->is_host()) - dynamic_cast(command::get(RAGE_JOAAT("breakup")))->call(player, {}), - NETWORK::NETWORK_SESSION_KICK_PLAYER(player->id()); + dynamic_cast(command::get(RAGE_JOAAT("multikick")))->call(player, {}); }); } @@ -90,4 +85,4 @@ namespace big process_common(player); } -} \ No newline at end of file +} diff --git a/src/services/context_menu/context_menu_service.hpp b/src/services/context_menu/context_menu_service.hpp index 4fa9f1f7..ecf09d2a 100644 --- a/src/services/context_menu/context_menu_service.hpp +++ b/src/services/context_menu/context_menu_service.hpp @@ -187,17 +187,9 @@ namespace big }}, {"KICK", [this] { - static player_command* command = dynamic_cast(command::get(rage::consteval_joaat("nfkick"))); - static player_command* command1 = dynamic_cast(command::get(rage::consteval_joaat("shkick"))); - static player_command* command2 = dynamic_cast(command::get(rage::consteval_joaat("endkick"))); - static player_command* command3 = dynamic_cast(command::get(rage::consteval_joaat("desync"))); - static player_command* command4 = dynamic_cast(command::get(rage::consteval_joaat("breakup"))); + static player_command* command = dynamic_cast(command::get(rage::consteval_joaat("multikick"))); command->call(ped::get_player_from_ped(m_handle), {}); - command1->call(ped::get_player_from_ped(m_handle), {}); - command2->call(ped::get_player_from_ped(m_handle), {}); - command3->call(ped::get_player_from_ped(m_handle), {}); script::get_current()->yield(500ms); - command4->call(ped::get_player_from_ped(m_handle), {}); }}, {"DISARM", [this] { diff --git a/src/services/squad_spawner/squad_spawner.cpp b/src/services/squad_spawner/squad_spawner.cpp index f1b994cb..9bb70b00 100644 --- a/src/services/squad_spawner/squad_spawner.cpp +++ b/src/services/squad_spawner/squad_spawner.cpp @@ -59,12 +59,7 @@ namespace big PED::SET_PED_ARMOUR(handle, s.m_ped_armor); } - if (s.does_squad_have_vehicle() && s.m_weapon_model != "WEAPON_UNARMED") - { - WEAPON::GIVE_WEAPON_TO_PED(handle, rage::joaat("WEAPON_MICROSMG"), 999, false, false); - } - - WEAPON::GIVE_WEAPON_TO_PED(handle, rage::joaat(s.m_weapon_model), 999, false, true); + WEAPON::GIVE_WEAPON_TO_PED(handle, rage::joaat(s.m_weapon_model), 9999, false, true); PED::SET_PED_ACCURACY(handle, s.m_ped_accuracy); PED::SET_PED_COMBAT_ABILITY(handle, (int)s.m_combat_ability_level); ENTITY::SET_ENTITY_INVINCIBLE(handle, s.m_ped_invincibility); @@ -336,4 +331,4 @@ namespace big } } } -} \ No newline at end of file +} diff --git a/src/views/players/player/player_kick.cpp b/src/views/players/player/player_kick.cpp index 97afe2fc..e3521e0e 100644 --- a/src/views/players/player/player_kick.cpp +++ b/src/views/players/player/player_kick.cpp @@ -26,8 +26,8 @@ namespace big ImGui::SameLine(); components::command_checkbox<"breakupcheating">(); - - components::player_command_button<"bailkick">(g_player_service->get_selected()); + + components::player_command_button<"multikick">(g_player_service->get_selected()); ImGui::SameLine(); components::player_command_button<"nfkick">(g_player_service->get_selected());