-
Автор темы
- #1
bool __stdcall fire_event::hook(IGameEvent* pEvent)
{
auto enemy = pEvent->GetInt("userid");
auto name = pEvent->GetName();
auto hitgroup = pEvent->GetInt("hitgroup");
// hitsound
C_BasePlayer* pAttacker = GetPlayer(pEvent->GetInt("attacker"));
C_BasePlayer* pVictim = GetPlayer(pEvent->GetInt("userid"));
if (!pAttacker || !pVictim || pAttacker != g_LocalPlayer)
return fireevent_original(g_GameEvents, pEvent);
if (!strcmp(name, ("player_hurt")))
{
switch (g_Options.misc.hitsound)
{
case 1:
g_VGuiSurface->PlaySound_("buttons//arena_switch_press_02.wav");
break;
case 2:
PlaySoundA(reinterpret_cast<LPCSTR>(buzina), NULL, SND_ASYNC | SND_MEMORY);
break;
case 3:
PlaySoundA(reinterpret_cast<LPCSTR>(neverlose), NULL, SND_ASYNC | SND_MEMORY);
break;
}
}
// headshot sound
bool headshot = pEvent->GetBool("headshot");
if (headshot)
{
C_BasePlayer* pAttacker = GetPlayer(pEvent->GetInt("attacker"));
C_BasePlayer* pVictim = GetPlayer(pEvent->GetInt("userid"));
if (!pAttacker || !pVictim || pAttacker != g_LocalPlayer)
return fireevent_original(g_GameEvents, pEvent);
switch (g_Options.misc.hshitsound)
{
case 1:
g_VGuiSurface->PlaySound_("buttons//arena_switch_press_02.wav");
break;
case 2:
PlaySoundA(reinterpret_cast<LPCSTR>(buzina), NULL, SND_ASYNC | SND_MEMORY);
break;
case 3:
PlaySoundA(reinterpret_cast<LPCSTR>(neverlose), NULL, SND_ASYNC | SND_MEMORY);
break;
}
}
return fireevent_original(g_GameEvents, pEvent);
}
{
auto enemy = pEvent->GetInt("userid");
auto name = pEvent->GetName();
auto hitgroup = pEvent->GetInt("hitgroup");
// hitsound
C_BasePlayer* pAttacker = GetPlayer(pEvent->GetInt("attacker"));
C_BasePlayer* pVictim = GetPlayer(pEvent->GetInt("userid"));
if (!pAttacker || !pVictim || pAttacker != g_LocalPlayer)
return fireevent_original(g_GameEvents, pEvent);
if (!strcmp(name, ("player_hurt")))
{
switch (g_Options.misc.hitsound)
{
case 1:
g_VGuiSurface->PlaySound_("buttons//arena_switch_press_02.wav");
break;
case 2:
PlaySoundA(reinterpret_cast<LPCSTR>(buzina), NULL, SND_ASYNC | SND_MEMORY);
break;
case 3:
PlaySoundA(reinterpret_cast<LPCSTR>(neverlose), NULL, SND_ASYNC | SND_MEMORY);
break;
}
}
// headshot sound
bool headshot = pEvent->GetBool("headshot");
if (headshot)
{
C_BasePlayer* pAttacker = GetPlayer(pEvent->GetInt("attacker"));
C_BasePlayer* pVictim = GetPlayer(pEvent->GetInt("userid"));
if (!pAttacker || !pVictim || pAttacker != g_LocalPlayer)
return fireevent_original(g_GameEvents, pEvent);
switch (g_Options.misc.hshitsound)
{
case 1:
g_VGuiSurface->PlaySound_("buttons//arena_switch_press_02.wav");
break;
case 2:
PlaySoundA(reinterpret_cast<LPCSTR>(buzina), NULL, SND_ASYNC | SND_MEMORY);
break;
case 3:
PlaySoundA(reinterpret_cast<LPCSTR>(neverlose), NULL, SND_ASYNC | SND_MEMORY);
break;
}
}
return fireevent_original(g_GameEvents, pEvent);
}