alliedmodders / amxmodx

AMX Mod X - Half-Life 1 Scripting and Administration
http://www.amxmodx.org/
494 stars 197 forks source link

The miscstats plugin prompts an error. Use amxmodx 1.10, rehlds #752

Open all85100 opened 5 years ago

all85100 commented 5 years ago

L 08/18/2019 - 14:07:40: Start of error session. L 08/18/2019 - 14:07:40: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20190818.log") L 08/18/2019 - 14:07:40: [CSTRIKE] Invalid player 6 (not in-game) L 08/18/2019 - 14:07:40: [AMXX] Run time error 10 (plugin "miscstats.amxx") (native "cs_get_user_team") - debug not enabled! L 08/18/2019 - 14:07:40: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

Dr-Strange91 commented 5 years ago

Same for [AMXX] 1.90.

Here is solution.

Edit .sma and compile it manually, we have to do it, unless AMXX don't fix this issue in base, they provide.

-if (wpnindex == CSW_C4) +if (wpnindex == CSW_C4 || !is_user_connected(victim))

https://dev-cs.ru/threads/4922/#post-50897

all85100 commented 5 years ago

Can you submit the solution to Pull requests, no one will encounter such a problem in the future?

xLeviNx commented 5 years ago

Same answer was posted on https://forums.alliedmods.net/showthread.php?t=316688

Arkshine commented 4 years ago

This is probably not the wanted solution because the stats should be saved and displayed (for killer) regardless of the victim is no more connected. Meaning to fix this, we need to track player's name and team instead so we don't rely on native (like cs_get_user_team) which throws an error if not connected.

Dr-Strange91 commented 4 years ago

@Arkshine So, what's alternative?

WPMGPRoSToTeMa commented 4 years ago

The main problem here is that I cannot imagine the case when victim can be disconnected. client_death is based on DeathMsg and Damage usermsgs.

DeathMsg is sent from CBasePlayer::Killed->CHalfLifeMultiplay::PlayerKilled->CHalfLifeMultiplay::DeathNotice, so victim is this from CBasePlayer::Killed and cannot be disconnected by design.

Damage is sent from CBasePlayer::UpdateClientData, victim is also this here, but I think in this case victim can be disconnected (e.g. in case of changelevel, but I'm not sure).

Before fixing that we need to find a root cause, so we will find a proper way to fix it.

RauliTop commented 4 years ago

This is probably not the wanted solution because the stats should be saved and displayed (for killer) regardless of the victim is no more connected. Meaning to fix this, we need to track player's name and team instead so we don't rely on native (like cs_get_user_team) which throws an error if not connected.

I think that simple fix should be applied.

Yes, it isn't the best way... but, at least, we stop the log error message. Then, investigate the correct way.

xLeviNx commented 4 years ago

This is probably not the wanted solution because the stats should be saved and displayed (for killer) regardless of the victim is no more connected. Meaning to fix this, we need to track player's name and team instead so we don't rely on native (like cs_get_user_team) which throws an error if not connected.

I think that simple fix should be applied.

Yes, it isn't the best way... but, at least, we stop the log error message. Then, investigate the correct way.

Defeats the purpose of tracking down the error then.

RauliTop commented 4 years ago

Defeats the purpose of tracking down the error then.

Only the person who track the error should test. The other server owners will not want to have a bunch of log errors.

Error is posted here, so... it can't be forgotten by applying a patch.