-
Автор темы
- #1
пытаюсь спаситить auto pick отсюда
В итоге у меня то он работает то нет, в чем проблема не пойму
вот мой код
2)как нарисовать круг на стартовой позиции?
3)в buybot, кс крашится после вызова
Пожалуйста, авторизуйтесь для просмотра ссылки.
в supremacy(https://yougame.biz/threads/156126/)В итоге у меня то он работает то нет, в чем проблема не пойму
C++:
#include "includes.h"
#define _USE_MATH_DEFINES
#include <math.h>
vec3_t quickpeekstartpos;
bool hasShot;
...
void Movement::AutoPeek() {
auto localPlayer = g_csgo.m_entlist->GetClientEntity< Player* >(g_csgo.m_engine->GetLocalPlayer());
if (!localPlayer || localPlayer->dormant() || !localPlayer->alive()) return;
if (g_input.GetKeyState(g_menu.main.movement.autopeek.get())) {
if (quickpeekstartpos == vec3_t { 0, 0, 0 }) {
quickpeekstartpos = g_cl.m_local->GetAbsOrigin();
g_notify.add(tfm::format(XOR("quickpeekstartpos!\n")));
}
else {
if (g_cl.m_old_shot && !hasShot) {
hasShot = true;
g_notify.add(tfm::format(XOR("hasShot = true!\n")));
}
if (hasShot) {
gotoStart();
}
}
}
else {
hasShot = false;
quickpeekstartpos = vec3_t { 0, 0, 0 };
}
}
void Movement::gotoStart() {
auto localPlayer = g_csgo.m_entlist->GetClientEntity< Player* >(g_csgo.m_engine->GetLocalPlayer());
if (!localPlayer || localPlayer->dormant() || !localPlayer->alive()) return;
float yaw = g_cl.m_cmd->m_view_angles.y;
vec3_t VecForward = g_cl.m_local->GetAbsOrigin() - quickpeekstartpos;
vec3_t translatedVelocity = vec3_t{
(float)(VecForward[0] * cos(yaw / 180 * (float)M_PI) + VecForward[1] * sin(yaw / 180 * (float)M_PI)),
(float)(VecForward[1] * cos(yaw / 180 * (float)M_PI) - VecForward[0] * sin(yaw / 180 * (float)M_PI)),
VecForward[2]
};
g_cl.m_cmd->m_forward_move = -translatedVelocity[0] * 20.f;
g_cl.m_cmd->m_side_move = translatedVelocity[1] * 20.f;
if (-translatedVelocity[0]* translatedVelocity[1]==0)
g_notify.add(tfm::format(XOR("0")));
}
g_csgo.m_engine->ExecuteClientCmd("buy deagle" );
на что это можно поменять?
Последнее редактирование: