Sending all kick methods (#1921)
This commit is contained in:
parent
e87931bf60
commit
a47af68384
@ -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.
|
For a complete list of available command functions, please refer to the command table documentation.
|
||||||
|
|
||||||
## Command Count: 213
|
## Command Count: 212
|
||||||
|
|
||||||
### bailkick
|
|
||||||
BAIL_KICK_DESC
|
|
||||||
Arg Count: 1
|
|
||||||
|
|
||||||
### bailkickall
|
|
||||||
BAIL_KICK_DESC
|
|
||||||
Arg Count: 0
|
|
||||||
|
|
||||||
### breakup
|
### breakup
|
||||||
BREAKUP_KICK_DESC
|
BREAKUP_KICK_DESC
|
||||||
@ -61,6 +53,10 @@ Arg Count: 1
|
|||||||
SCRIPT_HOST_KICK_DESC
|
SCRIPT_HOST_KICK_DESC
|
||||||
Arg Count: 1
|
Arg Count: 1
|
||||||
|
|
||||||
|
### multikick
|
||||||
|
MULTI_KICK_DESC
|
||||||
|
Arg Count: 1
|
||||||
|
|
||||||
### clearwanted
|
### clearwanted
|
||||||
CLEAR_WANTED_LEVEL_DESC
|
CLEAR_WANTED_LEVEL_DESC
|
||||||
Arg Count: 1
|
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) {
|
g_player_service->iterate([](auto& plyr) {
|
||||||
if (plyr.second->is_host())
|
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("multikick")))->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, {});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -40,12 +40,7 @@ namespace big
|
|||||||
{
|
{
|
||||||
g_fiber_pool->queue_job([player] {
|
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("multikick")))->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());
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,4 +85,4 @@ namespace big
|
|||||||
|
|
||||||
process_common(player);
|
process_common(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,17 +187,9 @@ namespace big
|
|||||||
}},
|
}},
|
||||||
{"KICK",
|
{"KICK",
|
||||||
[this] {
|
[this] {
|
||||||
static player_command* command = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("nfkick")));
|
static player_command* command = dynamic_cast<player_command*>(command::get(rage::consteval_joaat("multikick")));
|
||||||
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")));
|
|
||||||
command->call(ped::get_player_from_ped(m_handle), {});
|
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);
|
script::get_current()->yield(500ms);
|
||||||
command4->call(ped::get_player_from_ped(m_handle), {});
|
|
||||||
}},
|
}},
|
||||||
{"DISARM",
|
{"DISARM",
|
||||||
[this] {
|
[this] {
|
||||||
|
@ -59,12 +59,7 @@ namespace big
|
|||||||
PED::SET_PED_ARMOUR(handle, s.m_ped_armor);
|
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(s.m_weapon_model), 9999, false, true);
|
||||||
{
|
|
||||||
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);
|
|
||||||
PED::SET_PED_ACCURACY(handle, s.m_ped_accuracy);
|
PED::SET_PED_ACCURACY(handle, s.m_ped_accuracy);
|
||||||
PED::SET_PED_COMBAT_ABILITY(handle, (int)s.m_combat_ability_level);
|
PED::SET_PED_COMBAT_ABILITY(handle, (int)s.m_combat_ability_level);
|
||||||
ENTITY::SET_ENTITY_INVINCIBLE(handle, s.m_ped_invincibility);
|
ENTITY::SET_ENTITY_INVINCIBLE(handle, s.m_ped_invincibility);
|
||||||
@ -336,4 +331,4 @@ namespace big
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,8 @@ namespace big
|
|||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
components::command_checkbox<"breakupcheating">();
|
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();
|
ImGui::SameLine();
|
||||||
components::player_command_button<"nfkick">(g_player_service->get_selected());
|
components::player_command_button<"nfkick">(g_player_service->get_selected());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user