-
Автор темы
- #1
Thirdperson code:
void thirdperson()
{
if (g_vars.esp.thirdP && g_local->is_alive())
{
float range = g_vars.esp.distance_thirdP;
if (i::input->camera_in_thirdperson)
return;
vec3_t angles;
i::engine->get_viewangles(angles);
angles.z = 0.f;
vec3_t forward(math::angle_vector(angles));
vec3_t eye_pos(g_local->m_vecOrigin() + g_local->m_vecViewOffset());
vec3_t maximal(16.f, 16.f, 16.f);
ray_t ray(eye_pos, eye_pos - forward * range, -maximal, maximal);
trace_filter filter;
trace_t trace;
i::trace->trace_ray(ray, mask_solid, &filter, &trace);
if (trace.fraction < 1.f)
range *= trace.fraction;
angles.z = range;
i::input->camera_in_thirdperson = true;
i::input->camera_offset = angles;
}
else
{
i::input->camera_in_thirdperson = false;
i::input->camera_offset.z = 0;
}
}
override_view::hook:
void __fastcall hooks::clientmode::override_view::hook( void* ecx, void* edx, view_setup_t* view ) {
if ( !i::engine->is_in_game( ) || !g_local ) {
o_override_view( ecx, edx, view );
return;
}
thirdperson();
o_override_view( ecx, edx, view );
}
Вложения
-
3.2 MB Просмотры: 50