Hi,
I am coding an external private chat, trigger and no recoil is enough for me. I have implemented the both features and they are working fine in offline. But when i play online, my no recoil code starts acting strange. After each bullet it lowers the aim, i can't find what i am doing wrong. Help needed.
https://streamable.com/3v1ama
Code:
public static void RunRCS()
{
if (CheatStatus.RCSActive)
{
if (CLP.ShootedBullets > 1)
{
AssistsConfig.NewViewAngles = (CLP.ViewAngles + AssistsConfig.OldPunch) - (CLP.AimPunchAngles * 2.0f);
P.ClampAngle(AssistsConfig.NewViewAngles);
AssistsConfig.OldPunch = CLP.AimPunchAngles *2.0f;
CLP.ViewAngles = AssistsConfig.NewViewAngles;
}
else
{
AssistsConfig.OldPunch.X = AssistsConfig.OldPunch.Y = AssistsConfig.OldPunch.Z = 0;
}
}
}
public static Vector3 ClampAngle(Vector3 angle)
{
while (angle.Y > 180) angle.Y -= 360;
while (angle.Y < -180) angle.Y += 360;
if (angle.X > 89.0f && angle.X <= 180.0f) angle.X = 89.0f;
if (angle.X < -89.0f) angle.X = -89.0f;
if (angle.X > 180.0f)
angle.X -= 360.0f;
angle.Z = 0f;
return angle;
}