Closed justgo97 closed 1 year ago
Randomly? You mean this above code, sometimes works, sometimes not?
@Arkshine Yes exactly.
The changes related to this native is this: https://github.com/alliedmodders/amxmodx/pull/356/commits/da2abb9c3b7d68e5a6e926a4fcc58f4fe1345561; the ammo index retrieval is now based on WeaponList
message. But, I'm not sure how this would fail.
It happened once to me too, but I can't remember what plugin I was testing. What I remember is that the plugin was hooking WeaponList message, but it wasn't blocking or altering it. It was used only to retrieve data.
can you make a unique error log for this check and if possible with more info about what did go wrong :
(ammoIndex = WeaponsList[weaponId].ammoIndex1) < 0
for exemple :
L 10/02/2018 - 11:05:22: [CSTRIKE] Invalid ammo index :%d
L 10/02/2018 - 11:05:22: [AMXX] Displaying debug trace (plugin "ammo_test.amxx", version "unknown")
L 10/02/2018 - 11:05:22: [AMXX] Run time error 10: native error (native "cs_set_user_bpammo")
L 10/02/2018 - 11:05:22: [AMXX] [0] ammo_test.sma::cmd_test (line 13)
Just tried a little, and I can't reproduce. No idea when this happens?
Do you have a plugin messing with WeaponList
message?
No, i m not using other plugins expect for this one + default amxx plugins.
Hmm, it might be related to the code which disables the forwards (pfnMessageBegin
, etc.)
In the game, WeaponList
messages are sent from pfnServerActivate
.
Cstrike module enables the forwards at this point and disables them in pfnServerActivate
as post.
Would be it possible the server lagged at this point, making the messages be sent a little later, and at this point, the forwards are already disabled? This would mean WeaponList
would not be filled with data.
I can't see others reasons. This code should be removed https://github.com/alliedmodders/amxmodx/blob/master/modules/cstrike/cstrike/CstrikeMain.cpp#L110-L115 ; the forwards will be anyway disabled once WeaponList
is fully catched.
maybe add a check to see if the forwards are disabled and output an error message so we can be sure that the problem is there
Again this happend to me today, and this time not randomly :
Code:
#include <amxmodx>
#include <fun>
#include <cstrike>
public plugin_init()
{
register_clcmd("get_famas", "GiveFamas")
}
public GiveFamas(id)
{
give_item(id, "weapon_famas")
cs_set_user_bpammo(id, CSW_FAMAS, 100)
}
Error log:
L 07/01/2019 - 08:56:12: [CSTRIKE] Invalid weapon id 15
L 07/01/2019 - 08:56:12: [AMXX] Run time error 10 (plugin "ammo.amxx") (native "cs_set_user_bpammo") - debug not enabled!
L 07/01/2019 - 08:56:12: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
@Arkshine This time not using rehlds :
version
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 17:35:12 Jul 5 2017 (7559)
meta version
Metamod v1.21p37 2013/05/30 (5:13)
by Will Day
http://www.metamod.org/
Patch: Metamod-P (mm-p) v37
by Jussi Kivilinna
http://metamod-p.sourceforge.net/
compiled: Jun 13 2017, 23:20:55 EET (optimized)
amxx version
AMX Mod X 1.10.0.5257 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: May 16 2019 06:12:10
Built from: https://github.com/alliedmodders/amxmodx/commit/486da2f
Build ID: 5257:486da2f
Core mode: JIT+ASM32
Update :
seems restarting the server / changing map will fix it it seems to happen because of some delay / lag in loading
Not sure if this is fixed but closing it anyway, this bug doesn't happen when using ReAPI natives
Code :
Error :
Versions :
ReGameDLL version: 5.7.0.313-dev
this happens randomly, i m not using any other plugin.