-
Автор темы
- #1
Код:
void OnEvents(IGameEvent* pEvent);
Код:
void CMisc::OnEvents(IGameEvent* pEvent)
{
if (Settings::Misc::Killmessage)
{
if (!strcmp(pEvent->GetName(), "player_death"))
{
int attacker = Interfaces::Engine()->GetPlayerForUserID(pEvent->GetInt("attacker"));
int userid = Interfaces::Engine()->GetPlayerForUserID(pEvent->GetInt("userid"));
if (attacker != userid)
{
if (attacker == Interfaces::Engine()->GetLocalPlayer())
{
Interfaces::Engine()->ExecuteClientCmd("say Ваш текст");
}
}
}
}
if (Settings::Misc::Hurtmessage)
{
if (!strcmp(event->GetName(), "player_hurt"))
{
int attacker = Interfaces::Engine()->GetPlayerForUserID(pEvent->GetInt("attacker"));
if (Interfaces::Engine()->GetPlayerForUserID(attacker) == Interfaces::Engine()->GetLocalPlayer())
{
Interfaces::Engine()->ExecuteClientCmd("say Ваш текст");
}
}
}
}
Код:
if (g_pMisc)
g_pMisc->OnEvents(pEvent);
Код:
ImGui::Checkbox("Killspam", &Settings::Misc::Killmessage);
ImGui::Checkbox("Hurtspam", &Settings::Misc::Hurtmessage);
Код:
bool Killmessage = false;
bool Hurtmessage = false;
Код:
extern bool Killmessage;
extern bool Hurtmessage;