KIllSound

SCHOCKKTOLOGY

Пользователь
Регистрация
11 Окт 2019
Сообщения
11
Симпатии
1
Предупреждения
30
OS
Linux
Amx Mod X
AMXX 1.9.0
Билд
Exe version 1.1.2.7/Stdio (cstrike) ReHLDS version: 3.8.0.711-dev Build date: 13:13:38 Feb 6 2021 (2492) Build from: https://github.com/dreamstalker/rehlds/commit/722e19
ReGamedll
ReGameDL version: 5.20.0.492-dev
Metamod
Metamod-r v1.3.0.128, API (5:13)
Meta модули
Код:
[ 1] Reunion RUN- reunion_mm_i386.so v0.1.0.92c ini Start Never
[ 2] AMX Mod X RUN- amxmodx_mm_i386.so v1.9.0.5271ini Start ANY
[ 3] WHBlocker RUN- whblocker_mm_i386.sov1.5.697ini Chlvl ANY
[ 4] ReSemiclip RUN- resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 5] FakeMetaRUN- fakemeta_amxx_i386.so v1.9.0.5271pl2 ANYANY
[ 6] ReAPIRUN- reapi_amxx_i386.so v5.19.0.211-dev pl2 ANYNever
[ 7] CStrike RUN- cstrike_amxx_i386.sov1.9.0.5271pl2 ANYANY
[ 8] CSX RUN- csx_amxx_i386.so v1.9.0.5271pl2 ANYANY
[ 9] Ham Sandwich RUN- hamsandwich_amxx_i386.so v1.9.0.5271pl2 ANYANY
[10] MySQRUN- mysql_amxx_i386.so v1.9.0.5271pl2 ANYANY
[11] AuthEmu RUN- authemu_amxx_i386.sov5.2.12.425-dev pl2 ANYNever
[12] Engine RUN- engine_amxx_i386.so v1.9.0.5271pl2 ANYANY
Плагины
Код:
[ 1] Admin Base 1.8.1.3746 AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.9.0.5271 AMXX Dev Team admincmd.amxx running
[ 3] Slots Reservation 1.9.0.5271 AMXX Dev Team adminslots.amxx running
[ 4] Admin Chat 1.9.0.5271 AMXX Dev Team adminchat.amxxrunning
[ 5] [ReAPI] AdminFreeLook1.0ReHLDS Team adminfreelook.a running
[ 6] Stats Configuration 1.9.0.5271 AMXX Dev Team statscfg.amxx running
[ 7] StatsX (MastaMan Editi 1.9.0.5271 AMXX Dev Team &statsx_shell.am debug
[ 8] FreshBans1.4.3bkanagava freshbans.amxxrunning
[ 9] AuthEmu API 1.0Dev-MS Team authemu.amxx running
[ 10] Players Menu1.7neugomon players_menu.am running
[ 11] Maps Menu1.4.1 neugomon mapsmenu.amxx running
[ 12] Map Manager 2.5.61Mistrick mapmanager.amxx running
[ 13] Advanced Gag1.4.3 neygomon amx_gag.amxx running
[ 14] Lite Translit 2.8neygomon lite_translit.a running
[ 15] Night Free VIP 0.1XTCS night_free_vips running
[ 16] [ReAPI] No Team Flash0.0.3 Vaqtinchano_team_flash.a running
[ 17] Parachute Lite [ReAPI] 11.0 Leo_[BH] parachute.amxxrunning
[ 18] Reklama 20.05.2020 mx?! reklama.amxx running
[ 19] Advanced Kill Assists1.3a Xelsonkill_assist.amx running
[ 20] V.I.P Custom Weapons 1.0.0 Vaqtinchavip_custom.amxx debug
[ 21] V.I.P Custom AK-471.0.0 Vaqtinchacustom_ak47.amx running
[ 22] V.I.P Custom AWP 1.0.0 Vaqtinchacustom_awp.amxx running
[ 23] V.I.P Custom DEAGLE 1.0.0 Vaqtinchacustom_deagle.a running
[ 24] V.I.P Custom M4A1 1.0.0 Vaqtinchacustom_m4a1.amx running
[ 25] Block Pickup Gold 0.1Vaqtinchacustom_pickup.a running
Amxx Модули
Код:
FakeMeta 1.9.0.5271 AMX Mod X Dev Teamrunning
ReAPI 5.19.0.211 Asmodai & s1lent running
CStrike 1.9.0.5271 AMX Mod X Dev Teamrunning
nVault1.9.0.5271 AMX Mod X Dev Teamrunning
CSX1.9.0.5271 AMX Mod X Dev Teamrunning
Ham Sandwich1.9.0.5271 AMX Mod X Dev Teamrunning
MySQ 1.9.0.5271 AMX Mod X Dev Teamrunning
AuthEmu 5.2.12.425 Dev-MS.rurunning
Engine1.9.0.5271 AMX Mod X Dev Teamrunning
Sockets 1.9.0.5271 AMX Mod X Dev Teamrunning
Ошибка
Код:
Когда на сервере больше чем 2 или 3 игроков звуки убийств работают через раз, а когда играешь 1х1 все звуки работают на ура.
Исходник
Код:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define SAVE // Сохранять настройки игроков? Закомментировать для отключения

#if defined(SAVE)
#include <nvault>

#define FILE_NAME "killsounds" // название файла, в котором будут храниться настройки
#define SAVE_TYPE 2 // тип сохранения: 1 - nickname, 2 - steamid, 3 - ip

#define AUTORESET // автоматически удалять "неактивных" игроков. Закомментировать для отключения
#define AUTORESET_DAYS 30 // если авто-очистка включена, то считать игрока "неактивным", если он не посещал сервер <значение> дней

new g_nVault;
#endif

#define MAX_CLIENTS 32
#define m_LastHitGroup 75
#define m_bitsDamageType 76
#define m_pActiveItem 373
#define m_iId 43

new g_iKillCount[ MAX_CLIENTS +1 ];

new bool: g_bszFirstBlood;

new bool:g_bszSoundsEnable[MAX_CLIENTS +1];

new const SOUNDS_KILL[ ][ ] =
{
"soundkills/firstkill.wav",
"soundkills/doublekill.wav",
"soundkills/tripplekill.wav",
"soundkills/multikill.wav",
"soundkills/crazy.wav",
"soundkills/rampage.wav",
"soundkills/headshot.wav",
"soundkills/knife.wav",
"soundkills/grenade.wav"
};

public plugin_init( )
{
register_plugin( "", "", "" );

register_logevent( "LogEV_RoundStart", 2, "1=Round_Start" );

register_clcmd( "say /sounds", "Command_Sounds" );
register_clcmd( "say_team /sounds", "Command_Sounds" );

RegisterHam( Ham_Killed, "player", "CPlayer__Killed_Post", .Post = 1 );

#if defined(SAVE)
g_nVault = nvault_open(FILE_NAME);

#if defined(AUTORESET)
nvault_prune(g_nVault, 0, get_systime() - (86400 * AUTORESET_DAYS));
#endif
#endif
}

#if defined(SAVE)
public plugin_end()
nvault_close(g_nVault);

save_data(id)
{
new trackid[64];

if (!get_trackid(id, trackid, charsmax(trackid)))
return 0;

new value[2];
formatex(value, charsmax(value), "%d", g_bszSoundsEnable[id] ? 1 : 2); // патамуша nvault_get/lookup вернет "0" в случае, если ключ не найден.
nvault_set(g_nVault, trackid, value);

return 1;
}

#if AMXX_VERSION_NUM >= 183 && SAVE_TYPE == 2
load_data(id, const trackid[])
#else
load_data(id)
#endif
{
#if AMXX_VERSION_NUM >= 183 && SAVE_TYPE == 2
if (!authid_is_valid(trackid))
return 0;
#else
new trackid[72];

if (!get_trackid(id, trackid, charsmax(trackid)))
return 0;
#endif

new nResult = nvault_get(g_nVault, trackid);

if (!nResult)
return 0;

#if defined(AUTORESET)
nvault_touch(g_nVault, trackid, -1);
#endif

g_bszSoundsEnable[id] = nResult == 1 ? true : false;

return 1;
}

get_trackid(id, trackid[], len)
{
#if SAVE_TYPE == 1
get_user_name(id, trackid, len);
#endif // #elseif trabl
#if SAVE_TYPE == 2
get_user_authid(id, trackid, len);

if (!authid_is_valid(trackid))
return 0;
#endif
#if SAVE_TYPE == 3
get_user_ip(id, trackid, len, 1);
#endif
return 1;
}

#if SAVE_TYPE == 2
authid_is_valid(const authid[])
{
if (contain(authid, ":") != -1) // re Subb98
return 1;

return 0;
}
#endif
#endif // defined(SAVE)

public plugin_precache( )
{
for( new i = 0; i < sizeof SOUNDS_KILL; i++ )
engfunc( EngFunc_PrecacheSound, SOUNDS_KILL[ i ] );
}

public LogEV_RoundStart( )
{
g_bszFirstBlood = true;

for( new iPlayers = MAX_CLIENTS; iPlayers > 0; iPlayers-- )
g_iKillCount[ iPlayers ] = 0;
}

public Command_Sounds( iPlayer )
{
if( g_bszSoundsEnable[iPlayer] )
{
g_bszSoundsEnable[iPlayer] = false;

client_print( iPlayer, print_chat, "Звуки убийств отключены." );
}
else
{
g_bszSoundsEnable[iPlayer] = true;

client_print( iPlayer, print_chat, "Звуки убийств включены." );
}

#if defined(SAVE)
save_data(iPlayer);
#endif

return PLUGIN_HANDLED;
}

public CPlayer__Killed_Post( iVictim, iAttacker, iGib )
{
if( iVictim == iAttacker || !is_user_connected( iAttacker ) )
return;

if( !g_bszSoundsEnable[iAttacker] )
return;

new iBitsDamageType = get_pdata_int( iVictim, m_bitsDamageType );
new iLastHitGroup = get_pdata_int( iVictim, m_LastHitGroup );
new iActiveItem = get_pdata_cbase( iAttacker, m_pActiveItem );

if( pev_valid( iActiveItem ) != 2 )
return;

new iId = get_pdata_int( iActiveItem, m_iId, 4 );

g_iKillCount[ iAttacker ]++;

if( iLastHitGroup == HIT_HEAD )
{
if( g_bszFirstBlood )
{
client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 0 ] );

g_bszFirstBlood = false;
}
else
client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 6 ] );

return;
}

if( iId == CSW_KNIFE && iBitsDamageType & ( DMG_NEVERGIB | DMG_BULLET ) )
{
if( g_bszFirstBlood )
{
client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 0 ] );

g_bszFirstBlood = false;
}
else
client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 7 ] );

return;
}

if( ~iBitsDamageType & ( DMG_NEVERGIB | DMG_BULLET ) )
{
if( g_bszFirstBlood )
{
client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 0 ] );

g_bszFirstBlood = false;
}
else
client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 8 ] );

return;
}

if( g_bszFirstBlood )
{
client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 0 ] );

g_bszFirstBlood = false;
}
else
{
switch( g_iKillCount[ iAttacker ] )
{
case 2: client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 1 ] );
case 3: client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 2 ] );
case 4: client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 3 ] );
case 5: client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 4 ] );
case 6:
{
client_cmd( iAttacker, "spk %s", SOUNDS_KILL[ 5 ] );

g_iKillCount[ iAttacker ] = 5;
}
}
}
}

#if defined(SAVE)
#if AMXX_VERSION_NUM >= 183 && SAVE_TYPE == 2
public client_authorized(iPlayer, const authid[])
#else
public client_authorized(iPlayer)
#endif
{
#if AMXX_VERSION_NUM >= 183 && SAVE_TYPE == 2
if (!load_data(iPlayer, authid))
#else
if (!load_data(iPlayer))
#endif
g_bszSoundsEnable[iPlayer] = true;

g_iKillCount[ iPlayer ] = 0;
}
#else
public client_authorized(iPlayer)
{
g_bszSoundsEnable[iPlayer] = true;
g_iKillCount[ iPlayer ] = 0;
}
#endif // defined(SAVE)
все нормально работает когда 1-1 , а когда на сервере примерно 10-15 человек, звуки производятся через раз, бывает даже что вообще не играют
 
Сверху Снизу