Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void RCS::doRCS() {
- bool b = false;
- Vector newViewAngles;
- Vector oldAimPunch;
- oldAimPunch.x = oldAimPunch.y = oldAimPunch.z = 0;
- while (true) {
- if (cfg.rcs_enable == 1) {
- if (((GetKeyState(VK_LBUTTON) & 0x80) != 0) && !b) {
- b = true;
- }
- else if (((GetKeyState(VK_LBUTTON) & 0x80) == 0) && b) {
- b = false;
- }
- DWORD localPlayer = memory.Read<DWORD>(Client + Offsets::dwLocalPlayer);
- Vector punch = memory.Read<Vector>(localPlayer + Offsets::m_vecPunch);
- DWORD shotsFired = memory.Read<DWORD>(localPlayer + Offsets::m_iShotsFired);
- if (shotsFired > 1 && b) {
- float pos_x = cfg.rcs_x;
- float calculate_x = 2.f / 100;
- float p_x = calculate_x * pos_x;
- float pos_y = cfg.rcs_y;
- float calculate_y = 2.f / 100;
- float p_y = calculate_y * pos_y;
- if (pos_y > 100) {
- p_y = 2.f;
- }
- if (pos_y < 0) {
- p_y = 0.f;
- }
- if (pos_x > 100) {
- p_x = 2.f;
- }
- if (pos_x < 0) {
- p_x = 0.f;
- }
- DWORD clientState = memory.Read<DWORD>(Engine + Offsets::dwClientState);
- Vector currentViewAngles = memory.Read<Vector>(clientState + Offsets::dwClientState_ViewAngles);
- newViewAngles.x = ((currentViewAngles.x + oldAimPunch.x) - (punch.x * p_x));
- newViewAngles.y = ((currentViewAngles.y + oldAimPunch.y) - (punch.y * p_y));
- newViewAngles.z = 0;
- while (newViewAngles.y > 180)
- newViewAngles.y -= 360; //360
- while (newViewAngles.y < -180)
- newViewAngles.y += 360; //360
- if (newViewAngles.x > 89.0f)
- newViewAngles.x = 89.0f; //89
- if (newViewAngles.x < -89.0f)
- newViewAngles.x = -89.0f; //89
- newViewAngles.z = 0;
- oldAimPunch.x = punch.x * p_x;
- oldAimPunch.y = punch.y * p_y;
- oldAimPunch.z = 0;
- memory.Write<Vector>(clientState + Offsets::dwClientState_ViewAngles, newViewAngles);
- Sleep(1);
- }
- else {
- oldAimPunch.x = oldAimPunch.y = oldAimPunch.z = 0;
- }
- }
- Sleep(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement