Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MissedShots(IGameEvent* pEvent)
- {
- if (!Fire)
- return;
- if (!g_LocalPlayer)
- return;
- if (!g_LocalPlayer->IsAlive())
- return;
- if (strstr(pEvent->GetName(), "player_hurt"))
- {
- auto UID = g_EngineClient->GetPlayerForUserID(pEvent->GetInt("attacker"));
- if (UID == g_LocalPlayer->EntIndex())
- Fire = false;
- }
- if (!Fire)
- return;
- if (strstr(pEvent->GetName(), "bullet_impact") && Fire)
- {
- Vector Position = Vector(pEvent->GetInt("x"), pEvent->GetInt("y"), pEvent->GetInt("z"));
- auto UID = g_EngineClient->GetPlayerForUserID(pEvent->GetInt("userid"));
- if (UID != g_LocalPlayer->EntIndex())
- Fire = false;
- float DmgToPosition = Autowall::GetVecDamage(Position);
- int CurrentTarget = ct;
- if (CurrentTarget < 1 || CurrentTarget > 65)
- Fire = false;
- C_BasePlayer* p = C_BasePlayer::GetPlayerByIndex(CurrentTarget);
- if (!p || !p->IsPlayer() || !p->IsAlive())
- Fire = false;
- uint8_t LClr[4] = { 0, 128, 255, 255 };
- uint8_t TClr[4] = { 255, 255, 255, 255 };
- if (DmgToPosition > g_Options.rbot_mindamage_visible)
- {
- bool ResolverMiss = Backtracked[p->EntIndex()] >= std::fabs(p->m_flOldSimulationTime() - p->m_flSimulationTime());
- std::string reason = ResolverMiss ? " Resolver" : " Fakelag Fix";
- g_CVar->ConsoleColorPrintf(TClr, "[");
- g_CVar->ConsoleColorPrintf(LClr, "Sharken.pw");
- g_CVar->ConsoleColorPrintf(TClr, "] Missed shot due to ");
- g_CVar->ConsoleColorPrintf(LClr, reason.c_str());
- g_Event.Add("Missed shot due to" + reason, Color::White);
- }
- else
- {
- g_CVar->ConsoleColorPrintf(TClr, "[");
- g_CVar->ConsoleColorPrintf(LClr, "Sharken.pw");
- g_CVar->ConsoleColorPrintf(TClr, "] Missed shot due to ");
- g_CVar->ConsoleColorPrintf(LClr, "Spread");
- g_Event.Add("Missed shot due to spread", Color::White);
- }
- Fire = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement