Начинающий
- Статус
- Оффлайн
- Регистрация
- 10 Апр 2020
- Сообщения
- 21
- Реакции
- 1
я ваще увалень или как я не понимаю в чем трабл в расчете))))))
recoil.cpp:
#include "include.h"
void recoil::Thread() noexcept {
recoil::Init();
while (true) {
CheckWeaponHotkeys();
weapon_info current_weapon = recoil::weapons[recoil::CurrentWeapon];
float current_scope_multiplier = recoil::scope_multipliers[recoil::CurrentScope];
for (int bullets_shot = 0; bullets_shot < current_weapon.recoil_table.size(); bullets_shot++)
{
if (!recoil::Checks() && recoil::HipChecks())
{
double sens = recoil::IsCrouching() ? global::MoveSensitivity * 1.2 : global::MoveSensitivity * 0.63;
double Fov_multiplier = (float)global::FOV / 90.0f;
double table_x = current_weapon.recoil_table[bullets_shot][0];
double table_y = current_weapon.recoil_table[bullets_shot][1];
debug::AddLog("CURRENT SHOT: " + std::to_string(bullets_shot) + "| TABLE_X: " + std::to_string(table_x) + "| TABLE_Y: " + std::to_string(table_y));
float mult = (-0.03f * (sens * 3.0f) * (global::FOV / 90.0f));
double brake = 1.0;
double recoil_x = ((table_x * brake) * 1.6) / mult;
double recoil_y = ((table_y * brake)) / mult;
recoil_y *= 1.05;
if (global::Humanize > 0.0) {
randomize::Humanize(recoil_x, recoil_y);
}
double weapon_delay = current_weapon.delay;
double control_time = (recoil::CurrentWeapon == WEAPON_THOMPSON || recoil::CurrentWeapon == WEAPON_CUSTOM)
? weapon_delay
: current_weapon.control_time.at(bullets_shot);
debug::AddLog("X: " + std::to_string(recoil_x) + "| Y: " + std::to_string(recoil_y));
mouse::RelativeMove(weapon_delay, weapon_delay, recoil_x, recoil_y);
}
if (recoil::Checks()) {
double sens = recoil::IsCrouching() ? global::Sensitivity * 0.70 : global::Sensitivity * 0.335;
double Fov_multiplier = (float)global::FOV / 90.0f;
double table_x = current_weapon.recoil_table[bullets_shot][0];
double table_y = current_weapon.recoil_table[bullets_shot][1];
debug::AddLog("CURRENT SHOT: " + std::to_string(bullets_shot) + "| TABLE_X: " + std::to_string(table_x) + "| TABLE_Y: " + std::to_string(table_y));
float mult = (-0.03f * (sens * 3.0f) * (global::FOV / 90.0f));
double scope = 1.0;
double brake = 1.0;
double recoil_x = ((table_x * brake) * 1.6) / mult;
double recoil_y = ((table_y * brake)) / mult;
recoil_x *= current_scope_multiplier;
recoil_y *= current_scope_multiplier * 1.05;
if (global::Humanize > 0.0) {
randomize::Humanize(recoil_x, recoil_y);
}
double weapon_delay = current_weapon.delay;
double control_time = (recoil::CurrentWeapon == WEAPON_THOMPSON || recoil::CurrentWeapon == WEAPON_CUSTOM)
? weapon_delay
: current_weapon.control_time.at(bullets_shot);
debug::AddLog("X: " + std::to_string(recoil_x) + "| Y: " + std::to_string(recoil_y));
mouse::RelativeMove(weapon_delay, weapon_delay, recoil_x, recoil_y);
}
}
/*if (global::WeaponRec) {
rec::UpdateActiveWeapon();
}*/
SleepEx(1, false);
}
}
mouse.cpp:
void mouse::RelativeMove(double delay, double control_time, float x, float y) noexcept {
int x_ = 0, y_ = 0, t_ = 0;
for (int i = 1; i <= (int)control_time; ++i)
{
int xI = i * x / (int)control_time;
int yI = i * y / (int)control_time;
int tI = i * (int)control_time / (int)control_time;
int delta_x = xI - x_;
int delta_y = yI - y_;
mouse::Move(delta_x, delta_y);
tools:Sleep((int)tI - (int)t_);
x_ = xI;
y_ = yI;
t_ = tI;
}
tools::Sleep((int)delay - (int)control_time);
}
Пожалуйста, авторизуйтесь для просмотра ссылки.
(noad) - вот такая штукенция ужасная происходит