Исходник Hitsound and headshot sounds (csgosimple) C+P

Начинающий
Статус
Оффлайн
Регистрация
24 Янв 2019
Сообщения
13
Реакции[?]
11
Поинты[?]
0
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);
}
 
<3nca
Забаненный
Статус
Оффлайн
Регистрация
23 Янв 2020
Сообщения
137
Реакции[?]
46
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Дерьмо. Язай библиотеку буст...
 
Сверху Снизу