Проблема звуками.

Руслан Миронов

Пользователь
Регистрация
24 Июн 2017
Сообщения
276
Симпатии
3
Предупреждения
30
Пол
Мужской
OS
Linux
Amx Mod X
AMXX 1.9.0
Билд
ReHLDS version: 3.8.0.710-dev
ReGamedll
ReGameDLL version: 5.20.0.492-dev
Metamod
Metamod-r v1.3.0.128, API (5:13)
Meta модули
Код:
[ 1] AMX Mod X RUN - amxmodx.so v1.9.0.5263 ini Start ANY
[ 2] Rechecker RUN - rechecker.so v2.5 ini ANY
[ 3] ReSemiclip RUN - resemiclip.so v2.3.9 ini ANY
[ 4] Reunion RUN - reunion.so v0.1.0.135 ini Start Never
[ 5] ReAuthCheck RUN - reauthcheck.so v0.1.6 ini Start Never
[ 6] VoiceTranscoder RUN - vtc.so v2017RC5 ini ANY
[ 7] WHBlocker RUN - whblocker.so v1.5.697 ini ANY
[ 8] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl1 ANY
[ 9] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl1 ANY
[10] ReAPI RUN - reapi_amxx_i386.so v5.19.0.210-dev pl1 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[12] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[14] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl1 ANY Never
[15] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
[16] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl1 ANY ANY
Плагины
Код:
[ 1] Free BPammo Weapons v0.0.1 Vaqtincha free_bpammo_wea running
[ 2] Replace Info Message v2.3 maeStro aka 9iky replace_info_ms running
[ 3] ScreenMaker v1.1 neygomon screen_maker.am running
[ 4] Kills Counter v0.3 serfreeman1337 kills_counter.a running
[ 5] Knife Duel with Telepo v1.2 neygomon knife_duel.amxx running
[ 6] Auto Team Balance Adva v1.5.1 Radius auto_team_balan running
[ 7] Smoke: HealthNade v0.0.4b wopox1337 Smoke_HealthNad running
[ 8] Fake Ping v1.1 MeRcyLeZZ/gyxoBk FakePing.amxx running
[ 9] Mode 2x2 v2.5re s1lent mode.amxx running
[ 10] Weapon Model + Sound R v1.2 GHW_Chronic ghw_weapon_repl running
[ 11] SpecList v1.2a SasaiLalka speclist_rus.am running
[ 12] Advanced Kill Assists v1.3c Xelson kill_assist.amx running
[ 13] Time for info v1.0 neugomon time_for_info.a running
[ 14] ultimate_sounds running
Amxx Модули
Код:
CStrike 1.9.0.5263 AMX Mod X Dev Team running
CSX 1.9.0.5263 AMX Mod X Dev Team running
ReAPI 5.19.0.210 Asmodai & s1lent running
FakeMeta 1.9.0.5263 AMX Mod X Dev Team running
MySQL 1.9.0.5263 AMX Mod X Dev Team running
Ham Sandwich 1.9.0.5263 AMX Mod X Dev Team running
ReAimDetector 0.2.2 ReHLDS Team running
Engine 1.9.0.5263 AMX Mod X Dev Team running
nVault 1.9.0.5263 AMX Mod X Dev Team running
Fun 1.9.0.5263 AMX Mod X Dev Team running
Sockets2 1.8.1.3746 HLSW Dev Team running
RegEx 1.9.0.5263 AMX Mod X Dev Team running
Ошибка
Код:
Добрый вечер, почему то звуки иногда есть иногда нет, когда 2 чела на сервере все норм а когда много людей через раз играют звуки.
Исходник
Код:
#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)
Добрый вечер, почему то звуки иногда есть иногда нет, когда 2 чела на сервере все норм а когда много людей через раз играют звуки.
 
Сверху Снизу