Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ThirdPerson(ClientFrameStage_t curStage)
- {
- if (!g_pEngine->IsInGame() || !g_pEngine->IsConnected() || !g::pLocalEntity)
- return;
- static bool init = false;
- if (GetKeyState(VK_MBUTTON) && g::pLocalEntity->IsAlive())
- {
- if (init)
- {
- ConVar* sv_cheats = g_pCvar->FindVar("sv_cheats");
- *(int*)((DWORD)&sv_cheats->fnChangeCallback + 0xC) = 0; // ew
- sv_cheats->SetValue(1);
- g_pEngine->ExecuteClientCmd("thirdperson");
- }
- init = false;
- }
- else
- {
- if (!init)
- {
- ConVar* sv_cheats = g_pCvar->FindVar("sv_cheats");
- *(int*)((DWORD)&sv_cheats->fnChangeCallback + 0xC) = 0; // ew
- sv_cheats->SetValue(1);
- g_pEngine->ExecuteClientCmd("firstperson");
- }
- init = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement