So I went ahead and threw the code together in a fashion that works. However, This was not exactly the result I was expecting. Maybe it has to do with the way I am doing it but to me it seems to be super jumpy and fairly obvious what is going on. As well its not as clean of a rcs I as I was expecting to get. Is there a way to tighten up the shots to get them closer together and maybe make it less ew. I appreciate your help.
Code:
public static void rcs()
{
Vector2 oPunchAngle, nClientAngle;
oPunchAngle.X = oPunchAngle.Y = 0;
while (true)
{
Thread.Sleep(1);
int localPlayer = ReadMemory<int>((int)g_pClient + Offsets.offsetList["dwLocalPlayer"]);
int pShotFired = ReadMemory<int>(localPlayer + Offsets.offsetList["m_iShotsFired"]);
int pClientState = ReadMemory<int>((int)g_pEngine + Offsets.offsetList["dwClientState"]);
Vector2 BClientAngle = ReadMemory<Vector2>(pClientState + Offsets.offsetList["dwClientState_ViewAngles"]);
if (pShotFired > 1)
{
Vector2 vPunchAngle = ReadMemory<Vector2>(localPlayer + Offsets.offsetList["m_viewPunchAngle"]);
Vector2 vClientAngle = ReadMemory<Vector2>(pClientState + Offsets.offsetList["dwClientState_ViewAngles"]);
nClientAngle.X = ((vClientAngle.X + oPunchAngle.X) - (vPunchAngle.X * 2.0f));
nClientAngle.Y = ((vClientAngle.Y + oPunchAngle.Y) - (vPunchAngle.Y * 2.0f));
while (nClientAngle.Y > 180)
nClientAngle.Y -= 360;
while (nClientAngle.Y < -180)
nClientAngle.Y += 360;
if (nClientAngle.X > 89.0f)
nClientAngle.X = 89.0f;
if (nClientAngle.X < -89.0f)
nClientAngle.X = -89.0f;
WriteMemory<Vector2>(pClientState + Offsets.offsetList["dwClientState_ViewAngles"], nClientAngle);
oPunchAngle.X = vPunchAngle.X * 2.0f;
oPunchAngle.Y = vPunchAngle.Y * 2.0f;
}
else
{
oPunchAngle.X = oPunchAngle.Y = 0;
}
}
}