-
Автор темы
- #1
Now everyone can add this to their xy0 pasta and become Xane
Everything here should be self explainatory even with the lack of comments.
Also m using imgui drawlist cuz didn't wanna bother adding a dx9 renderer.
In Action :
Everything here should be self explainatory even with the lack of comments.
Also m using imgui drawlist cuz didn't wanna bother adding a dx9 renderer.
In Action :
Код:
Draw Starting Position
Code:
void Misc :: drawStartPos (ImDrawList * dl) {
if (quickpeekstartpos! = Vector {0, 0, 0}) {
ImVec2 startpos;
if (dx9w2s (quickpeekstartpos, startpos))
dl-> AddCircleFilled (startpos, 10, ImColor (1.f, 1.f, 1.f, 1.f), 32);
}
}
Goto start
Code:
void gotoStart (UserCmd * cmd) {
auto localPlayer = interfaces.entityList-> getEntity (interfaces.engine-> getLocalPlayer ());
if (! localPlayer || localPlayer-> isDormant () ||! localPlayer-> isAlive ()) return;
Vector playerLoc = localPlayer-> getAbsOrigin ();
float yaw = cmd-> viewangles.y;
Vector VecForward = playerLoc - quickpeekstartpos;
Vector translatedVelocity = Vector {
(float) (VecForward.x * cos (yaw / 180 * (float) M_PI) + VecForward.y * sin (yaw / 180 * (float) M_PI)),
(float) (VecForward.y * cos (yaw / 180 * (float) M_PI) - VecForward.x * sin (yaw / 180 * (float) M_PI)),
VecForward.z
};
cmd-> forwardmove = -translatedVelocity.x * 20.f;
cmd-> sidemove = translatedVelocity.y * 20.f;
}
The main function
Code:
void Misc :: quickpeek (UserCmd * cmd) {
auto localPlayer = interfaces.entityList-> getEntity (interfaces.engine-> getLocalPlayer ());
if (! localPlayer || localPlayer-> isDormant () ||! localPlayer-> isAlive ()) return;
if (GetAsyncKeyState (VK_XBUTTON2)) {
if (quickpeekstartpos == NULL) {
quickpeekstartpos = localPlayer-> getAbsOrigin ();
}
else {
if (cmd-> buttons & UserCmd :: IN_ATTACK) hasShot = true;
if (hasShot) {
gotoStart (cmd);
}
}
}
else {
hasShot = false;
quickpeekstartpos = Vector {0, 0, 0};
}
} [/ CODE]