Add Instant revive and automatic F4 for MVM
This commit is contained in:
parent
713e601117
commit
759e1a4aae
@ -40,6 +40,8 @@
|
||||
<AutoVariable width="fill" target="killstreak.enable" label="Enable killstreak"/>
|
||||
<AutoVariable width="fill" target="misc.backpack-expander.enabled" label="Expand backpack"/>
|
||||
<AutoVariable width="fill" target="misc.backpack-expander.slot-count" label="Backpack slots" min="1" max="3000"/>
|
||||
<AutoVariable width="fill" target="mvmtools.instant-revive" label="MVM Instant revive"/>
|
||||
<AutoVariable width="fill" target="mvmtools.auto-f4" label="Auto F4"/>
|
||||
</List>
|
||||
</Box>
|
||||
</Tab>
|
||||
|
@ -9,10 +9,10 @@
|
||||
class CGameRules
|
||||
{
|
||||
public:
|
||||
int pad0[12]; // 0 | 48 bytes | 48
|
||||
int roundmode; // 48 | 4 bytes | 52
|
||||
int pad1[1]; // 52 | 4 bytes | 56
|
||||
int winning_team; // 56 | 4 bytes | 60
|
||||
char pad2[974]; // 60 | 974 bytes | 1034
|
||||
bool isPVEMode; // 1034 | 1 byte | 1035
|
||||
int pad0[12]; // 0 | 48 bytes | 48
|
||||
int roundmode; // 48 | 4 bytes | 52
|
||||
int m_bInWaitingForPlayers; // 52 | 4 bytes | 56
|
||||
int winning_team; // 56 | 4 bytes | 60
|
||||
char pad2[974]; // 60 | 974 bytes | 1034
|
||||
bool isPVEMode; // 1034 | 1 byte | 1035
|
||||
};
|
||||
|
@ -31,6 +31,7 @@ set(files "${CMAKE_CURRENT_LIST_DIR}/AutoJoin.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Killstreak.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Misc.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/MiscPlayerInfo.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/MVMTools.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/NavBot.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Noisemaker.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/PureBypass.cpp"
|
||||
|
30
src/hacks/MVMTools.cpp
Normal file
30
src/hacks/MVMTools.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
#include "common.hpp"
|
||||
|
||||
namespace hacks::tf2::mvmtools
|
||||
{
|
||||
static settings::Boolean auto_revive("mvmtools.instant-revive", "false");
|
||||
static settings::Boolean auto_f4("mvmtools.auto-f4", "false");
|
||||
|
||||
static Timer revive_timer{};
|
||||
static Timer ready_timer{};
|
||||
|
||||
void CreateMove()
|
||||
{
|
||||
if (CE_INVALID(LOCAL_E))
|
||||
return;
|
||||
// only in MVM
|
||||
if (!g_pGameRules->isPVEMode)
|
||||
return;
|
||||
|
||||
if (auto_revive && !LOCAL_E->m_bAlivePlayer() && revive_timer.test_and_set(1000))
|
||||
{
|
||||
auto *kv = new KeyValues("MVM_Revive_Response");
|
||||
kv->SetInt("accepted", 1);
|
||||
g_IEngine->ServerCmdKeyValues(kv);
|
||||
}
|
||||
if (auto_f4 && g_pGameRules->roundmode == 10 && ready_timer.test_and_set(10000))
|
||||
g_IEngine->ServerCmd("tournament_player_readystate 1");
|
||||
}
|
||||
|
||||
static InitRoutine init([]() { EC::Register(EC::CreateMove, CreateMove, "mvmtools_createmove"); });
|
||||
} // namespace hacks::tf2::mvmtools
|
Reference in New Issue
Block a user