Hi,
please, can you tip me, why this sometimes cause:
Quote:
L 02/12/2019 - 00:55:08: [SM] Exception reported: Client 8 is not connected
L 02/12/2019 - 00:55:08: [SM] Blaming: l4d_panic_stunning.smx::OnNormalSoundPlay
L 02/12/2019 - 00:55:08: [SM] Exception reported: Client 8 is not connected
L 02/12/2019 - 00:55:08: [SM] Blaming: l4d_panic_stunning.smx::OnNormalSoundPlay
L 02/12/2019 - 00:55:08: [SM] Exception reported: Client 8 is not connected
.....
|
PHP Code:
AddNormalSoundHook(OnNormalSoundPlay);
...
public Action OnNormalSoundPlay(int clients[MAXPLAYERS], int &numClients,
char sample[PLATFORM_MAX_PATH], int &entity, int &channel, float &volume, int &level,
int &pitch, int &flags, char soundEntry[PLATFORM_MAX_PATH], int &seed)
{
if ((StrContains(sample, SOUND_DESTROY_1) == -1) && // exclude destroying sound
(StrContains(sample, SOUND_DESTROY_2) == -1) &&
(StrContains(sample, SOUND_DESTROY_3) == -1) &&
(StrContains(sample, SOUND_DESTROY_4) == -1))
{
if (numClients == 0 || !g_bAtLeastOneDeaf) return Plugin_Continue; // just in case
//remove clients from array
bool bFlag = false;
int i, j;
for (i = 0; i < numClients; i++)
{
if (!bFlag)
{
if (g_iDeafLock[clients[i]] > 0 || !IsClientInGame(clients[i]))
{
bFlag = true; // at least one deaf client
j = i; // deaf client pos mark
numClients--;
}
}
else {
if (g_iDeafLock[clients[i]] > 0 || !IsClientInGame(clients[i]))
{
numClients--;
}
else {
clients[j] = clients[i]; // move values to the left
j++;
}
}
}
if (numClients == 0)
{
return Plugin_Handled;
}
return Plugin_Changed;
}
return Plugin_Continue;
}
g_iDeafLock is array of "booleans" 0, 1 - that define whether client should be deaf.
As you can see IsClientInGame is exist and should filter "Client 8 is not connected" error.
Thanks.
__________________