kitty.
-
Автор темы
- #1
абалдеть... всем привет, сегодня база мне подогнала такое чудо, простую систему записи рекордов!!! БАЗА КОРМИТ
написано на quality mega super puper wok v2 sdk, работоспособность проверена(работает как швейцарские часы)
C++:
#pragma once
class c_lag_record {
public:
c_cs_player* m_player;
int m_index;
bool is_dormant;
bool is_immune;
vec3_t m_origin;
vec3_t m_abs_origin;
vec3_t m_velocity;
vec3_t m_anim_velocity;
vec3_t m_obb_min;
vec3_t m_obb_max;
float m_sim_time;
float m_duck_amount;
float m_lby;
qangle_t m_eye_angles;
qangle_t m_abs_angles;
qangle_t m_rotation;
anim_layers_t m_layers;
pose_params_t m_poses;
matrix3x4_t m_bones[128];
int m_anim_delay;
bit_flag_t<uint32_t> m_flags;
c_lag_record(c_cs_player* player) {
if (!player || !player->is_alive())
return;
m_player = player;
m_index = m_player->get_index();
m_anim_delay = TIME_TO_TICKS(m_player->get_sim_time() - m_player->get_old_sim_time());
is_dormant = m_player->is_dormant();
is_immune = m_player->is_immune();
m_origin = m_player->get_origin();
m_abs_origin = m_player->get_abs_origin();
m_velocity = m_player->get_velocity();
m_obb_min = m_player->get_collideable()->obb_mins();
m_obb_max = m_player->get_collideable()->obb_maxs();
m_sim_time = m_player->get_sim_time();
m_duck_amount = m_player->get_duck_amount();
m_lby = m_player->get_lby();
m_eye_angles = m_player->get_eye_angles();
m_abs_angles = m_player->get_abs_angles();
m_rotation = m_player->get_rotation();
m_flags = m_player->get_flags();
memcpy(m_layers.data(), m_player->get_anim_layers().data(), sizeof(anim_layer_t) * 15);
memcpy(m_poses.data(), m_player->get_pose_params().data(), sizeof(float) * 24);
memcpy(m_bones, m_player->get_bone_cache()->m_cached_bones, sizeof(matrix3x4_t) * m_player->get_bone_cache()->m_cached_bones_count); // снеси эту хуйню либо добавь в проверку и сторь уже адекватно ребилднутый кости в ребилднутом setup_bones((((
}
};
class c_record_system : public c_singleton<c_record_system> {
public:
void on_frame_stage(e_client_frame_stage stage);
void update_animations(c_lag_record* record);
};
extern std::array<std::deque<c_lag_record>, 64u> m_records;
#define record_system c_record_system::instance()
C++:
#include "../features.h"
std::array<std::deque<c_lag_record>, 64u> m_records;
void c_record_system::on_frame_stage(e_client_frame_stage stage) {
if (stage != FRAME_NET_UPDATE_END)
return;
for (auto i = 0; i < interfaces::m_global_vars->m_max_clients; i++) {
auto player = reinterpret_cast<c_cs_player*>(interfaces::m_entity_list->get_client_entity(i));
if (!player || !player->is_alive() || !player->is_player() || !player->is_enemy(globals::m_local))
continue;
auto update = m_records.at(i).empty() || (!m_records.at(i).empty() && player->get_sim_time() > m_records.at(i).front().m_sim_time);
if (update && player->get_sim_time() <= player->get_old_sim_time())
update = false;
if (update) {
m_records.at(i).emplace_front(c_lag_record(player));
update_animations(&m_records.at(i).front());
player->setup_bones(nullptr, 128, BONE_FLAG_USED_BY_ANYTHING, player->get_sim_time());
}
while (m_records.at(i).size() > 32)
m_records.at(i).pop_back();
}
}
void c_record_system::update_animations(c_lag_record* record) {
}
написано на quality mega super puper wok v2 sdk, работоспособность проверена(работает как швейцарские часы)
Последнее редактирование: