show spectators & fix minor menu issues

This commit is contained in:
Lighty 2018-04-19 15:20:46 +02:00
parent ff731fffaf
commit 08ef28e0ad
2 changed files with 60 additions and 25 deletions

View File

@ -50,6 +50,9 @@ CatVar tauntslide(CV_SWITCH, "tauntslide", "0", "TF2C tauntslide",
CatVar tauntslide_tf2(CV_SWITCH, "tauntslide_tf2", "0", "Tauntslide", CatVar tauntslide_tf2(CV_SWITCH, "tauntslide_tf2", "0", "Tauntslide",
"Allows free movement while taunting with movable " "Allows free movement while taunting with movable "
"taunts\nOnly works in tf2"); "taunts\nOnly works in tf2");
CatVar
show_spectators(CV_SWITCH, "show_spectators", "0", "Show spectators",
"Show who's spectating you\nonly works in valve servers");
void *C_TFPlayer__ShouldDraw_original = nullptr; void *C_TFPlayer__ShouldDraw_original = nullptr;
@ -108,7 +111,6 @@ CatCommand
void CreateMove() void CreateMove()
{ {
// Crithack // Crithack
static IClientEntity *localplayer, *weapon, *last_weapon = nullptr; static IClientEntity *localplayer, *weapon, *last_weapon = nullptr;
static int tries, cmdn, md5seed, rseed, c, b; static int tries, cmdn, md5seed, rseed, c, b;
@ -123,22 +125,23 @@ void CreateMove()
static IClientEntity *last_checked_weapon = nullptr; static IClientEntity *last_checked_weapon = nullptr;
/*IF_GAME (IsTF2()) { /*IF_GAME (IsTF2()) {
if (crit_hack_next && CE_GOOD(LOCAL_E) && CE_GOOD(LOCAL_W) && WeaponCanCrit() && RandomCrits()) { if (crit_hack_next && CE_GOOD(LOCAL_E) && CE_GOOD(LOCAL_W) &&
PROF_SECTION(CM_misc_crit_hack_prediction); WeaponCanCrit() && RandomCrits()) {
weapon = RAW_ENT(LOCAL_W); PROF_SECTION(CM_misc_crit_hack_prediction);
// IsBaseCombatWeapon weapon = RAW_ENT(LOCAL_W);
if (weapon && // IsBaseCombatWeapon
vfunc<bool(*)(IClientEntity*)>(weapon, 1944 / 4, 0)(weapon)) { if (weapon &&
/*if (experimental_crit_hack.KeyDown()) { vfunc<bool(*)(IClientEntity*)>(weapon, 1944 / 4, 0)(weapon)) {
if (!g_pUserCmd->command_number || critWarmup < 8) { /*if (experimental_crit_hack.KeyDown()) {
if (g_pUserCmd->buttons & IN_ATTACK) { if (!g_pUserCmd->command_number || critWarmup < 8) {
critWarmup++; if (g_pUserCmd->buttons & IN_ATTACK) {
} else { critWarmup++;
critWarmup = 0; } else {
} critWarmup = 0;
g_pUserCmd->buttons &= ~(IN_ATTACK); }
} g_pUserCmd->buttons &= ~(IN_ATTACK);
}*/ /* }
}*/ /*
if (g_pUserCmd->command_number && if (g_pUserCmd->command_number &&
(last_checked_weapon != (last_checked_weapon !=
weapon || last_checked_command_number < weapon || last_checked_command_number <
@ -280,7 +283,7 @@ void CreateMove()
static bool flswitch = false; static bool flswitch = false;
if (flswitch && !g_pUserCmd->impulse) if (flswitch && !g_pUserCmd->impulse)
g_pUserCmd->impulse = 100; g_pUserCmd->impulse = 100;
flswitch = !flswitch; flswitch = !flswitch;
} }
} }
@ -317,7 +320,7 @@ void CreateMove()
if (!(hacks::shared::antiaim::enabled && if (!(hacks::shared::antiaim::enabled &&
hacks::shared::antiaim::yaw_mode && hacks::shared::antiaim::yaw_mode &&
!(side || forward))) !(side || forward)))
g_pUserCmd->viewangles.y = camera_angle[1]; g_pUserCmd->viewangles.y = camera_angle[1];
g_pLocalPlayer->v_OrigViewangles.y = camera_angle[1]; g_pLocalPlayer->v_OrigViewangles.y = camera_angle[1];
// Use silent since we dont want to prevent the player from // Use silent since we dont want to prevent the player from
@ -375,7 +378,37 @@ void DrawText()
fonts::font_main, color); fonts::font_main, color);
}*/ }*/
if (show_spectators)
{
for (int i = 0; i < 32; i++)
{
// Assign the for loops tick number to an ent
CachedEntity *ent = ENTITY(i);
player_info_s info;
if (!CE_BAD(ent) && ent != LOCAL_E &&
ent->m_Type == ENTITY_PLAYER &&
(CE_INT(ent, netvar.hObserverTarget) & 0xFFF) ==
LOCAL_E->m_IDX &&
CE_INT(ent, netvar.iObserverMode) >= 4 &&
g_IEngine->GetPlayerInfo(i, &info))
{
auto observermode = "N/A";
switch (CE_INT(ent, netvar.iObserverMode))
{
case 4:
observermode = "Firstperson";
break;
case 5:
observermode = "Thirdperson";
break;
case 7:
observermode = "Freecam";
break;
}
AddSideString(format(info.name, " ", observermode));
}
}
}
if (!debug_info) if (!debug_info)
return; return;
if (CE_GOOD(g_pLocalPlayer->weapon())) if (CE_GOOD(g_pLocalPlayer->weapon()))
@ -655,9 +688,9 @@ static CatCommand
const char *ft = (args.ArgC() > 1 ? args[2] : 0); const char *ft = (args.ArgC() > 1 ? args[2] : 0);
DumpRecvTable(ent, clz->m_pRecvTable, 0, ft, 0); DumpRecvTable(ent, clz->m_pRecvTable, 0, ft, 0);
}); });
} } // namespace misc
} } // namespace shared
} } // namespace hacks
/*void DumpRecvTable(CachedEntity* ent, RecvTable* table, int depth, const char* /*void DumpRecvTable(CachedEntity* ent, RecvTable* table, int depth, const char*
ft, unsigned acc_offset) { bool forcetable = ft && strlen(ft); if (!forcetable ft, unsigned acc_offset) { bool forcetable = ft && strlen(ft); if (!forcetable

View File

@ -451,6 +451,7 @@ static const std::string list_tf2 = R"(
"gui_ncc_font_family" "gui_ncc_font_family"
"gui_ncc_font_title_family" "gui_ncc_font_title_family"
"fast_outline" "fast_outline"
"show_spectators"
"ESP" [ "ESP" [
"ESP Menu" "ESP Menu"
"esp_enabled" "esp_enabled"
@ -586,7 +587,7 @@ static const std::string list_tf2 = R"(
"Air Stuck Menu" "Air Stuck Menu"
"airstuck" "airstuck"
] ]
"Anti-/Anti-Aim" [ "Anti-Aim" [
"Anti-Aim Menu" "Anti-Aim Menu"
"aa_enabled" "aa_enabled"
"aa_realfakes" "aa_realfakes"
@ -603,7 +604,8 @@ static const std::string list_tf2 = R"(
"aa_no_clamp" "aa_no_clamp"
"resolver" "resolver"
"identify" "identify"
"Anti Anti Aim" [ "Anti-/Anti-Aim" [
"Anti-/Anti-Aim"
"aa_aaaa_enabled" "aa_aaaa_enabled"
"aa_aaaa_flip_key" "aa_aaaa_flip_key"
"aa_aaaa_mode" "aa_aaaa_mode"