Add Dominatemark
This commit is contained in:
parent
699e72840f
commit
20e87c02e4
@ -3,6 +3,7 @@
|
|||||||
<Include path="nullifiedcat/visuals/esp.xml"/>
|
<Include path="nullifiedcat/visuals/esp.xml"/>
|
||||||
<Include path="nullifiedcat/visuals/glow.xml"/>
|
<Include path="nullifiedcat/visuals/glow.xml"/>
|
||||||
<Include path="nullifiedcat/visuals/chams.xml"/>
|
<Include path="nullifiedcat/visuals/chams.xml"/>
|
||||||
|
<Include path="nullifiedcat/visuals/dominatemark.xml"/>
|
||||||
<Include path="nullifiedcat/visuals/tracers.xml"/>
|
<Include path="nullifiedcat/visuals/tracers.xml"/>
|
||||||
<Include path="nullifiedcat/visuals/radar.xml"/>
|
<Include path="nullifiedcat/visuals/radar.xml"/>
|
||||||
<Include path="nullifiedcat/visuals/playerinfo.xml"/>
|
<Include path="nullifiedcat/visuals/playerinfo.xml"/>
|
||||||
|
9
data/menu/nullifiedcat/visuals/dominatemark.xml
Normal file
9
data/menu/nullifiedcat/visuals/dominatemark.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<Tab name="Dominatemark" padding="4 4 4 4">
|
||||||
|
<Box padding="12 6 6 6" width="content" height="content" name="Player Info">
|
||||||
|
<List width="150">
|
||||||
|
<AutoVariable width="fill" target="dominatemark.enable" label="Enable"/>
|
||||||
|
<AutoVariable width="fill" target="dominatemark.min-size" label="Draw min size"/>
|
||||||
|
<AutoVariable width="fill" target="dominatemark.max-size" label="Draw max size"/>
|
||||||
|
</List>
|
||||||
|
</Box>
|
||||||
|
</Tab>
|
Binary file not shown.
Before Width: | Height: | Size: 390 KiB After Width: | Height: | Size: 396 KiB |
Binary file not shown.
@ -6,6 +6,13 @@ namespace re
|
|||||||
class CTFPlayerShared
|
class CTFPlayerShared
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
inline static bool IsDominatingPlayer(CTFPlayerShared *self, int ent_idx)
|
||||||
|
{
|
||||||
|
static auto signature = gSignatures.GetClientSignature("55 89 E5 56 53 83 EC ? 8B 5D ? E8 ? ? ? ? 89 C6 31 C0");
|
||||||
|
typedef bool (*IsDominatingPlayer_t)(CTFPlayerShared *, int);
|
||||||
|
static IsDominatingPlayer_t IsDominatingPlayer_fn = IsDominatingPlayer_t(signature);
|
||||||
|
return IsDominatingPlayer_fn(self, ent_idx);
|
||||||
|
}
|
||||||
inline static float GetCritMult(CTFPlayerShared *self)
|
inline static float GetCritMult(CTFPlayerShared *self)
|
||||||
{
|
{
|
||||||
return ((fminf(fmaxf(*(float *) (unsigned(self) + 672) * 0.0039215689f, 0.0f), 1.0f) * 3.0f) + 1.0f);
|
return ((fminf(fmaxf(*(float *) (unsigned(self) + 672) * 0.0039215689f, 0.0f), 1.0f) * 3.0f) + 1.0f);
|
||||||
|
@ -40,6 +40,7 @@ target_sources(cathook PRIVATE
|
|||||||
add_subdirectory(ac)
|
add_subdirectory(ac)
|
||||||
if(EnableVisuals)
|
if(EnableVisuals)
|
||||||
target_sources(cathook PRIVATE
|
target_sources(cathook PRIVATE
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}/DominateMark.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/ESP.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/ESP.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Tracers.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Tracers.cpp"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/Radar.cpp"
|
"${CMAKE_CURRENT_LIST_DIR}/Radar.cpp"
|
||||||
|
48
src/hacks/DominateMark.cpp
Normal file
48
src/hacks/DominateMark.cpp
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/* Made by BenCat07
|
||||||
|
*
|
||||||
|
* On 30th of March
|
||||||
|
* 2019
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include "common.hpp"
|
||||||
|
static settings::Bool draw_dominate{ "dominatemark.enable", "false" };
|
||||||
|
static settings::Float min_size{ "dominatemark.min-size", "15.0f" };
|
||||||
|
static settings::Float max_size{ "dominatemark.max-size", "40.0f" };
|
||||||
|
|
||||||
|
static InitRoutine init([]() {
|
||||||
|
EC::Register(EC::Draw,
|
||||||
|
[]() {
|
||||||
|
if (!*draw_dominate)
|
||||||
|
return;
|
||||||
|
if (CE_BAD(LOCAL_E))
|
||||||
|
return;
|
||||||
|
re::CTFPlayerShared *shared_player = &re::C_BasePlayer::shared_(RAW_ENT(LOCAL_E));
|
||||||
|
for (int i = 0; i < g_IEngine->GetMaxClients(); i++)
|
||||||
|
{
|
||||||
|
CachedEntity *ent = ENTITY(i);
|
||||||
|
if (CE_GOOD(ent) && ent->m_bAlivePlayer() && re::CTFPlayerShared::IsDominatingPlayer(shared_player, i))
|
||||||
|
{
|
||||||
|
Vector draw_pos;
|
||||||
|
float size;
|
||||||
|
if (!ent->hitboxes.GetHitbox(0))
|
||||||
|
continue;
|
||||||
|
// Calculate draw pos
|
||||||
|
auto c = ent->InternalEntity()->GetCollideable();
|
||||||
|
draw_pos = ent->m_vecOrigin();
|
||||||
|
draw_pos.z += c->OBBMaxs().z;
|
||||||
|
// Calculate draw size
|
||||||
|
size = *max_size * 1.5f - ent->m_flDistance() / 20.0f;
|
||||||
|
size = fminf(*max_size, size);
|
||||||
|
size = fmaxf(*min_size, size);
|
||||||
|
|
||||||
|
Vector out;
|
||||||
|
if (draw::WorldToScreen(draw_pos, out))
|
||||||
|
{
|
||||||
|
static textures::sprite sprite = textures::atlas().create_sprite(447, 257, 64, 64);
|
||||||
|
sprite.draw(int(out.x - size / 2.0f), int(out.y - size), int(size), int(size), colors::white);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dominatemark_draw");
|
||||||
|
});
|
Reference in New Issue
Block a user