Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some error in td_gunmod.amxx #23

Closed
talibanaa opened this issue Oct 18, 2021 · 1 comment
Closed

Some error in td_gunmod.amxx #23

talibanaa opened this issue Oct 18, 2021 · 1 comment
Assignees

Comments

@talibanaa
Copy link

L 10/18/2021 - 21:17:46: Player 1 is not in game.
L 10/18/2021 - 21:17:46: [AMXX] Displaying debug trace (plugin "td_gunmod.amxx", version "1.1")
L 10/18/2021 - 21:17:46: [AMXX] Run time error 10: native error (native "menu_display")
L 10/18/2021 - 21:17:46: [AMXX] [0] td_gunmod.sma::showWeaponMenu (line 541)
L 10/18/2021 - 21:17:46: [AMXX] [1] td_gunmod.sma::playerSpawned (line 298)

And im use the last rehlds amxx regame and server crash sometimes ? When will be see version 2.0 ot that mod! Thanks

@gtteamamxx
Copy link
Owner

gtteamamxx commented Oct 19, 2021

Hi @talibanaa,
Thanks for contact.

Unfurtunly I'm unable to check this issue at runtime right now, but if you look at source code

public playerSpawned(id)
{
if(!strlen(g_PlayerSelectedWeapons[id][0]) && !strlen(g_PlayerSelectedWeapons[id][1]))
showWeaponMenu(id);
set_task(0.5, "givePlayerWeapons", id + 516);
}

We can assume that the issue is because this method:
L 10/18/2021 - 21:17:46: [AMXX] [0] td_gunmod.sma::showWeaponMenu (line 541)

is invoked by this line of code

set_task(0.5, "givePlayerWeapons", id + 516);

You see that magic 0.5? It tells "open weapon menu after 0.5 seconds of player spawn".

And it looks like target player just disconnected in that 0.5s.

To fix that we could add a validation to method which throws error showWeaponMenu

public showWeaponMenu(id)
{
if(!g_isGameAvailable)
return;
static szTitle[64];
new iPlayerLevel = g_PlayerLevel[id];
formatex(szTitle, 63, "Your level:\r %d^n\wExp:\r %d\w /\r %d", iPlayerLevel, g_PlayerExp[id], g_ExpTable[iPlayerLevel]);

There's missing

if (!is_user_connected(id)) {
   return;
}

This error is not affecting a game - low priority bug. Server crashes - yeah, are caused by this mod but after some investigations year or two ago I'm 100% sure it's because this mod is maintaining high amount of entities and even on ReHLDS old GoldSrc engine can't stand that so it restarts. Maybe you can try to change monsters count on wave to 10-15 max.

I don't think there would be version 2.0. I was 16-18 with my twin brother when we created this mod. Nowadays we're professional programmers, oldest, and I don't think we have time to play games :D

Maybe in future :)

Thanks for playing this mod.
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants