Hot Keys Increment FoV Value

Posts 1–4 of 4 · Page 1 of 1
Hot Keys Increment FoV Value
So for my C++ FoV Changer, I want to be able to press VK_PRIOR to increment the field of view value by 5 each time it is pressed. Vice versa for VK_NEXT. The address I write to each increment are: 0x063FB5C0 and 0x063FB5D0

Also, the default will be 80 so when you press VK_PRIOR it boosts it up to 85 the first time you press it, then the second time you press it, you get 90. Vice versa for VK_NEXT, Press once to get 75, again for 70 etc. If you could help me, I'd appreciate it very much. Thanks
EDIT: I worded that HORRIBLY. In simpler terms, I want it so when I press Page Up key, it boosts the degrees of field of view by 5, and when I press Page Down, it decrements the degrees of field of view by 5.
Code:
float CurrentFOV;
ReadProcessMemory( hProcess, FOVAddress, &CurrentFOV, 4, NULL );

switch( KeyPressed )
{
	case VK_PRIOR:

		CurrentFOV += 5.f;
		break;

	case VK_NEXT:

		CurrentFOV -= 5.f;
		break;

	default:

		break;
}

WriteProcessMemory( hProcess, FOVAddress, &CurrentFOV, 4, NULL );
Quote Originally Posted by intervention61 View Post
Code:
float CurrentFOV;
ReadProcessMemory( hProcess, FOVAddress, &CurrentFOV, 4, NULL );

switch( KeyPressed )
{
	case VK_PRIOR:

		CurrentFOV += 5.f;
		break;

	case VK_NEXT:

		CurrentFOV -= 5.f;
		break;

	default:

		break;
}

WriteProcessMemory( hProcess, FOVAddress, &CurrentFOV, 4, NULL );
Thank you, I got it all working now, except for KeyPressed... I know it may seem completely obvious but I'm missing it. What do I do with it? What type of variable is it?
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us