internal fov changer

Posts 1–8 of 8 · Page 1 of 1
internal fov changer
Im relatively new and confused where to go from here because my slider isnt doing anything :^(


Code:
typedef void(__thiscall* OverrideView_t)(CViewSetup*);
void __stdcall Hooked_OverrideView(CViewSetup* pSetup)
{
	if (Settings.GetBoolSetting(Tab_Visuals, Vis_Active))
	{
		if (Interfaces.pEngine->IsInGame() && Interfaces.pEngine->IsConnected() && Settings.GetSetting(Tab_Visuals, Vis_FOV) != 0)
		{
			if (!Hacks.LocalPlayer->m_bIsScoped()) {
				pSetup->fov = Settings.GetSetting(Tab_Visuals, Vis_FOV);
				pSetup->fovViewmodel = Settings.GetSetting(Tab_Visuals, Vis_FOV);
			}
		}
	}
	
	VMTClientMode.HookMethod((DWORD)&Hooked_OverrideView, 18);
}
you cant change viewmodel in overrideview, wont work. return original only if you dont change fov, that should do the job.
Quote Originally Posted by certmemer View Post
you cant change viewmodel in overrideview, wont work. return original only if you dont change fov, that should do the job.
You can hook GetViewModelFOV at index 35
This works for me
Code:
	namespace OverrideView
	{
		typedef void(__stdcall* oOverrideView)(CViewSetup*);
		bool DoOnce = false;
		void __stdcall OverrideView(CViewSetup* pViewSetup)
		{
			if (!DoOnce)
			{
				std::cout << "OverrideView" << std::endl;
				DoOnce = true;
			}
			if (Interfaces::m_pEngine->IsConnected() && Interfaces::m_pEngine->IsInGame())
			{
				pViewSetup->fov = Settings::Misc::ViewFoV;
				pViewSetup->fovViewmodel = Settings::Misc::ViewFoV;
			}
			else
			{
				m_pClientModeHook->GetMethod<oOverrideView>(18)(pViewSetup);
			}
		}
	}
@affe2626 you could as well remove these checks, as far i know its not called when youre not in game
Quote Originally Posted by certmemer View Post
@affe2626 you could as well remove these checks, as far i know its not called when youre not in game
I did also think so at first but I added that std::cout << "OverrideView" std::endl and it printed it at the menu.

- - - Updated - - -

Quote Originally Posted by grisgato View Post
Alright im swallowing my pride and asking again I cannot seem to get this to work, I've tried different things, quite new to this apologies.
Add something to OverrideView to see if you've hooked it right like a cout as I did and post some more code so we can help you :P
Alright im swallowing my pride and asking again I cannot seem to get this to work, I've tried different things, quite new to this apologies.
Code:
typedef void(__thiscall* OverrideView_t)(CViewSetup*);
void __stdcall Hooked_OverrideView(CViewSetup* pSetup)
{
	if (Settings.GetBoolSetting(Tab_Visuals, Vis_Active) && Interfaces.pEngine->IsInGame() && Interfaces.pEngine->IsConnected() && Settings.GetSetting(Tab_Visuals, Vis_FOV) != 0)
	{
		if (!Hacks.LocalPlayer->m_bIsScoped()) 
			{
			pSetup->fov = Settings.GetSetting(Tab_Visuals, Vis_FOV);
			pSetup->fovViewmodel = Settings.GetSetting(Tab_Visuals, Vis_FOV); //won't work anyway, may as well remove it
			}
			else 
			VMTClientMode.HookMethod((DWORD)&Hooked_OverrideView, 18);
	}
	else 
	VMTClientMode.HookMethod((DWORD)&Hooked_OverrideView, 18);
	
}
idk, try this one
sorry for fucking up the indentation

- - - Updated - - -

Quote Originally Posted by affe2626 View Post
Add something to OverrideView to see if you've hooked it right like a cout as I did and post some more code so we can help you :P
he always called original, i think that was the problem.
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us