Exploits

TF2 [MvM] Instant Respawn/Revive

Submitted by Joe mamas, , Thread ID: 169161

Thread Closed
27-04-2020, 07:29 AM
This post was last modified: 27-04-2020, 07:30 AM by Joe mamas
#1
With the recent leak, i figure i might aswell post this since it's propably going to get figured out real fast anyway.

By sending the CommandKeyValues "MVM_Revive_Response" with "accepted" "1" the game will instantly respawn you, or if you are currently getting revived by a medigun, will instantly spawn you as if you got revived

instant_revive.cpp

Code:

  1. #include "Main.h"



  2. InstantReviveListener g_ReviveListener;



  3. /*

  4. * Game event "revive_player_notify", Tick 12337:

  5. - "marker_entindex" = "374"

  6. - "entindex" = "1"

  7. */



  8. void InstantReviveListener::FireGameEvent(IGameEvent *event)

  9. {

  10. if (!g_Settings->instant_revive || !Globals->local_player)

  11. return;



  12. const int revivee = event->GetInt("entindex");

  13. if (revivee != Globals->local_player->GetIndex())

  14. return;



  15. auto *kv = new KeyValues("MVM_Revive_Response");

  16. kv->SetInt("accepted", 1);

  17. I::Engine->ServerCmdKeyValues(kv);

  18. }



  19. void InstantReviveListener::Register()

  20. {

  21. I::GameEvents->AddListener(this, "revive_player_notify", false);

  22. }



  23. void InstantReviveListener::Unregister()

  24. {

  25. I::GameEvents->RemoveListener(this);

  26. }

instant_revive.h
Code:
  1. #pragma once



  2. class InstantReviveListener : public IGameEventListener2

  3. {

  4. public:

  5. void FireGameEvent(IGameEvent *event) override;



  6. void Register();

  7. void Unregister();

  8. };



  9. extern InstantReviveListener g_ReviveListener;

Instant Respawn anytime when dead

Code:
  1. void SmallMisc::RespawnKey()

  2. {

  3. if (!Utils::IsKeyDown(g_Settings->respawn_key))

  4. return;



  5. auto *kv = new KeyValues("MVM_Revive_Response");

  6. kv->SetInt("accepted", 1);

  7. I::Engine->ServerCmdKeyValues(kv);

  8. }

Users browsing this thread: 1 Guest(s)