Merge pull request #362 from nullifiedcat/BenCat07-patch-1

Update
This commit is contained in:
BenCat07 2018-03-08 17:06:58 +01:00 committed by GitHub
commit 32ba88bdd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 63 additions and 48 deletions

View File

@ -14,6 +14,8 @@ namespace shared
namespace antiaim
{
CatVar communicate(CV_SWITCH, "identify", "1",
"Auto identify for other cathook users");
CatVar enabled(CV_SWITCH, "aa_enabled", "0", "Anti-Aim",
"Master AntiAim switch");
CatVar yaw(CV_FLOAT, "aa_yaw", "0.0", "Yaw", "Static yaw (left/right)", 360.0);
@ -67,7 +69,7 @@ float GetAAAAPitch()
case 1:
return aaaa_stage ? 271 : 89;
default:
break;
break;
}
return 0;
}
@ -177,7 +179,7 @@ void FuckPitch(float &io_pitch)
case k_EFuckMode::FM_RANDOMVARS:
io_pitch = RandFloatRange(min_pitch, max_pitch);
default:
break;
break;
}
if (io_pitch < min_pitch)
@ -200,7 +202,7 @@ void FuckYaw(float &io_yaw)
case k_EFuckMode::FM_RANDOMVARS:
io_yaw = RandFloatRange(min_yaw, max_yaw);
default:
break;
break;
}
if (io_yaw < min_yaw)
@ -254,7 +256,7 @@ bool ShouldAA(CUserCmd *cmd)
}
break;
default:
break;
break;
}
if (safe_space)
{
@ -378,8 +380,47 @@ float useEdge(float edgeViewAngle)
return edgeYaw;
}
Timer delay{};
int val = 0;
void ProcessUserCmd(CUserCmd *cmd)
{
if (communicate && CE_GOOD(LOCAL_E))
{
for (int i = 0; i < g_IEngine->GetMaxClients(); i++)
{
CachedEntity *ent = ENTITY(i);
if (CE_GOOD(ent))
{
if ((int) (CE_FLOAT(ent, netvar.angEyeAngles)) == 53 &&
(int) (CE_FLOAT(ent, netvar.angEyeAngles + 4)) == 33)
{
player_info_s info;
if (g_IEngine->GetPlayerInfo(ent->m_IDX, &info) &&
playerlist::AccessData(info.friendsID).state !=
playerlist::k_EState::CAT)
{
playerlist::AccessData(info.friendsID).state =
playerlist::k_EState::CAT;
cmd->viewangles.y = 53;
cmd->viewangles.x = 33;
g_pLocalPlayer->bUseSilentAngles = true;
}
return;
}
}
}
if (delay.test_and_set(180000) || val)
{
cmd->viewangles.y = 53;
cmd->viewangles.x = 33;
g_pLocalPlayer->bUseSilentAngles = true;
val++;
if (val == 3)
val = 0;
return;
}
}
if (!ShouldAA(cmd))
return;
float &p = cmd->viewangles.x;
@ -424,7 +465,7 @@ void ProcessUserCmd(CUserCmd *cmd)
FuckYaw(y);
clamp = false;
default:
break;
break;
}
switch (int(pitch_mode))

View File

@ -659,12 +659,20 @@ static CatVar clean_chat(CV_SWITCH, "clean_chat", "0", "Clean chat",
"Removes newlines from chat");
static CatVar dispatch_log(CV_SWITCH, "debug_log_usermessages", "0",
"Log dispatched user messages");
std::string clear = "";
static bool firstcall = true;
std::string clear = "";
Timer sendmsg{};
Timer gitgud{};
std::string lastfilter{};
std::string lastname{};
static bool retrun = false;
bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
{
if (retrun && gitgud.test_and_set(10000))
{
PrintChat("\x07%06X%s\x01: %s", 0xe05938, lastname.c_str(),
lastfilter.c_str());
retrun = false;
}
int loop_index, s, i, j;
char *data, c;
@ -697,18 +705,6 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
message.push_back(c);
}
}
static const char *lastfilter;
static const char *lastname;
static bool retrun = false;
if (data[0] != LOCAL_E->m_IDX)
{
if (retrun)
{
PrintChat("\x07%06X%s\x01: \x07%06X%s\x01", 0xe05938,
lastname, 0xefec1f, lastfilter);
retrun = false;
}
}
if (chat_filter_enabled && data[0] != LOCAL_E->m_IDX)
{
if (!strcmp(chat_filter.GetString(), ""))
@ -822,13 +818,13 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
if (clear == "")
{
for (int i = 0; i < 100; i++)
for (int i = 0; i < 120; i++)
clear += "\n";
}
chat_stack::Say(". " + clear, true);
retrun = true;
lastfilter = filter.c_str();
lastname = name.c_str();
lastfilter = format(filter);
lastname = format(name);
}
}
}
@ -854,45 +850,23 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
if (clear == "")
{
clear = "";
for (int i = 0; i < 100; i++)
for (int i = 0; i < 120; i++)
clear += "\n";
}
chat_stack::Say(". " + clear, true);
retrun = true;
lastfilter = filter.c_str();
lastname = name.c_str();
lastfilter = format(filter);
lastname = format(name);
}
}
}
}
if (crypt_chat)
{
if (sendmsg.test_and_set(300000))
chat_stack::Say("!!meow", false);
firstcall = false;
if (message.find("!!") == 0)
{
static player_info_s info;
static unsigned steamid;
if (ucccccp::validate(message))
{
if (g_IEngine->GetPlayerInfo(data[0], &info) &&
playerlist::AccessData(steamid).state !=
playerlist::k_EState::CAT)
{
steamid = info.friendsID;
CachedEntity *entity = ENTITY(data[0]);
if (CE_GOOD(entity))
{
if (boost::algorithm::contains(
ucccccp::decrypt(message), "meow"))
{
playerlist::AccessData(steamid).state =
playerlist::k_EState::CAT;
chat_stack::Say("!!meow", false);
}
}
}
PrintChat("\x07%06X%s\x01: %s", 0xe05938, name.c_str(),
ucccccp::decrypt(message).c_str());
}