mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +08:00
Sending all kick methods (#1921)
This commit is contained in:
parent
e9f206c0df
commit
182a80a951
@ -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
|
||||
|
38
src/backend/commands/player/kick/multi_kick.cpp
Normal file
38
src/backend/commands/player/kick/multi_kick.cpp
Normal file
@ -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<command_context> ctx) override
|
||||
{
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("nfkick")))->call(player, {});
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("oomkick")))->call(player, {});
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("endkick")))->call(player, {});
|
||||
script::get_current()->yield(700ms);
|
||||
|
||||
if (g_player_service->get_self()->is_host())
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("hostkick")))->call(player, {});
|
||||
|
||||
if (!player->is_host() && !g_player_service->get_self()->is_host())
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("desync")))->call(player, {});
|
||||
|
||||
if (g_player_service->get_self()->is_host())
|
||||
dynamic_cast<player_command*>(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);
|
||||
}
|
@ -14,9 +14,7 @@ namespace big
|
||||
g_player_service->iterate([](auto& plyr) {
|
||||
if (plyr.second->is_host())
|
||||
{
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("bailkick")))->call(plyr.second, {});
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("nfkick")))->call(plyr.second, {});
|
||||
//dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(plyr.second, {});
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("multikick")))->call(plyr.second, {});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -40,12 +40,7 @@ namespace big
|
||||
{
|
||||
g_fiber_pool->queue_job([player] {
|
||||
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("bailkick")))->call(player, {});
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("nfkick")))->call(player, {});
|
||||
script::get_current()->yield(700ms);
|
||||
if(g_player_service->get_self()->is_host())
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(player, {}),
|
||||
NETWORK::NETWORK_SESSION_KICK_PLAYER(player->id());
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("multikick")))->call(player, {});
|
||||
});
|
||||
}
|
||||
|
||||
@ -90,4 +85,4 @@ namespace big
|
||||
|
||||
process_common(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -187,17 +187,9 @@ namespace big
|
||||
}},
|
||||
{"KICK",
|
||||
[this] {
|
||||
static player_command* command = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("nfkick")));
|
||||
static player_command* command1 = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("shkick")));
|
||||
static player_command* command2 = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("endkick")));
|
||||
static player_command* command3 = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("desync")));
|
||||
static player_command* command4 = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("breakup")));
|
||||
static player_command* command = dynamic_cast<player_command*>(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] {
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user