Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. void ThirdPerson(ClientFrameStage_t curStage)
  2. {
  3. if (!g_pEngine->IsInGame() || !g_pEngine->IsConnected() || !g::pLocalEntity)
  4. return;
  5.  
  6. static bool init = false;
  7.  
  8. if (GetKeyState(VK_MBUTTON) && g::pLocalEntity->IsAlive())
  9. {
  10. if (init)
  11. {
  12. ConVar* sv_cheats = g_pCvar->FindVar("sv_cheats");
  13. *(int*)((DWORD)&sv_cheats->fnChangeCallback + 0xC) = 0; // ew
  14. sv_cheats->SetValue(1);
  15. g_pEngine->ExecuteClientCmd("thirdperson");
  16. }
  17. init = false;
  18. }
  19. else
  20. {
  21. if (!init)
  22. {
  23. ConVar* sv_cheats = g_pCvar->FindVar("sv_cheats");
  24. *(int*)((DWORD)&sv_cheats->fnChangeCallback + 0xC) = 0; // ew
  25. sv_cheats->SetValue(1);
  26. g_pEngine->ExecuteClientCmd("firstperson");
  27. }
  28. init = true;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement