Welcome to hackvshack.net Forum!
Download Free HvH CS2/CS:GO Cheats, CFG, LUA/JS Scripts, and More!
Register

C++ LW Hitmarker + Damage marker

quantumware

quantumware
User ID:
4
Messages:
29
Reactions:
529
Badges:
13
REP:
−0/0+
Level:
133
so here i am, helping pastors.

1622512449763.png
[REACT=1]
Hitmarker.cpp

#include "..\..\includes.hpp" #include "hitmarker.h" #include "other_esp.h" player_t* get_entity(const int index) { return reinterpret_cast<player_t*>(m_entitylist()->GetClientEntity(index)); } void hitmarker::listener( IGameEvent * game_event ) { if ( !vars.esp.hitmarker[1]) return; const auto attacker = m_engine()->GetPlayerForUserID( game_event->GetInt( "attacker" ) ); const auto victim = m_engine()->GetPlayerForUserID( game_event->GetInt( "userid" ) ); if ( attacker != m_engine()->GetLocalPlayer() ) return; if ( victim == m_engine()->GetLocalPlayer() ) return; const auto player = get_entity( victim ); if ( !player || !(player->m_iTeamNum() != csgo.local()->m_iTeamNum()) ) return; } void hitmarker::draw_hits() { for ( auto i = 0; i < hits.size(); i++ ) { auto& hit = hits[ i ]; if ( hit.time + 2.1f < m_globals()->m_curtime ) { hits.erase( hits.begin() + i ); i--; } Vector screen_pos; if ( math::world_to_screen( hit.pos, screen_pos ) ) { render_hitmarker( hit, screen_pos ); render_damage( hit, screen_pos, Color(255, 0, 0) ); } } } void hitmarker::add_hit( const hitmarker_t hit ) { hits.push_back( hit ); } void hitmarker::render_hitmarker( hitmarker_t& hit, const Vector& screen_pos ) { static auto line_size = 6; const auto step = 255.f / 1.0f * m_globals()->m_frametime; const auto step_move = 30.f / 1.5f * m_globals()->m_frametime; const auto multiplicator = 0.3f; hit.moved -= step_move; if ( hit.time + 1.8f <= m_globals()->m_curtime ) hit.alpha -= step; const auto int_alpha = static_cast< int >( hit.alpha ); if ( int_alpha > 0 ) { auto col = Color( 255, 255, 255, int_alpha ); Draw::DrawLine(screen_pos.x + 3, screen_pos.y + 3, screen_pos.x + 6, screen_pos.y + 6, Color(255, 255, 255, int_alpha)); Draw::DrawLine(screen_pos.x - 3, screen_pos.y - 3, screen_pos.x - 6, screen_pos.y - 6, Color(255, 255, 255, int_alpha)); Draw::DrawLine(screen_pos.x + 3, screen_pos.y - 3, screen_pos.x + 6, screen_pos.y - 6, Color(255, 255, 255, int_alpha)); Draw::DrawLine(screen_pos.x - 3, screen_pos.y + 3, screen_pos.x - 6, screen_pos.y + 6, Color(255, 255, 255, int_alpha)); } } void hitmarker::render_damage(hitmarker_t& hit, const Vector& screen_pos, Color col) { static auto line_size = 6; const auto step = 255.f / 1.0f * m_globals()->m_frametime; const auto step_move = 30.f / 1.5f * m_globals()->m_frametime; const auto multiplicator = 0.3f; hit.moved -= step_move; if (hit.time + 1.2f <= m_globals()->m_curtime) hit.alpha -= step; const auto int_alpha = static_cast<int>(hit.alpha); if (int_alpha > 0) { std::stringstream dmg; dmg << "-" << std::to_string(hit.damage); Draw::Text(screen_pos.x + 8 - hit.moved, screen_pos.y - 12 + hit.moved / 3, font::marker, Color(col.r(), col.g(), col.b(), int_alpha), false, dmg.str().c_str()); } }

Hitmarker.h

#pragma once #include "..\..\includes.hpp" struct hitmarker_t { hitmarker_t( const float& time, const int& index, const int& damage, const int& hitgroup, const Vector& pos ) { this->time = time; this->index = index; this->damage = damage; this->hitgroup = hitgroup; this->pos = pos; moved = 0.f; alpha = 255.f; } float time; int index; int damage; int hitgroup; float moved; float alpha; Color col; Vector pos; }; class hitmarker : public singleton<hitmarker> { public: void listener( IGameEvent * game_event ); void draw_hits(); void render_damage(hitmarker_t& hit, const Vector& screen_pos, Color col); void add_hit( hitmarker_t hit ); static void render_hitmarker( hitmarker_t& hit, const Vector & screen_pos ); std::deque<hitmarker_t> hits; }; hooked_events.cpp(after if(current_shot)) hitmarker::get().add_hit(hitmarker_t(m_globals()->m_curtime, user_id, damage, hitgroup, entity->hitbox_position_matrix(get_hitbox_by_hitgroup(hitgroup), current_shot && entity == aim::get().last_target[current_shot->last_target].record.player ? aim::get().last_target[current_shot->last_target].record.matrixes_data.main : entity->m_CachedBoneData().Base()))); player_esp.cpp, in paint_traverse() func hitmarker::get().draw_hits();

[/REACT]
 

Who has read this thread (Total: 0) in last 1 hours View details