Enjoy this, it works amazingly. Since I take so much code from this site I might as well share this.
Code:
public Vector3 prevAngle;
public bool strafing;
public void BHOP()
{
if (Toggles.Default.Bunnyhop)
{
if (Keyboard.IsKeyDown(System.Windows.Forms.Keys.Space))
{
//If player is on ground
if (csgo.onGround())
{
csgo.setC_Jump(6);
}
if (!csgo.onGround() && Toggles.Default.AutoStrafe)
{
Vector3 ang = csgo.m_vecViewAngles();
if (!strafing)
{
prevAngle = ang;
}
strafing = true;
if (ang.y > prevAngle.y)
{
csgo.setC_Left(1);
csgo.setC_Right(0);
}
else if (ang.y < prevAngle.y)
{
csgo.setC_Left(0);
csgo.setC_Right(1);
}
prevAngle = ang;
}
}
else if (!Keyboard.IsKeyDown(System.Windows.Forms.Keys.Space) && Toggles.Default.AutoStrafe)
{
prevAngle = csgo.m_vecViewAngles();
if (strafing)
{
csgo.setC_Left(0);
csgo.setC_Right(0);
}
strafing = false;
}
}
}