B3none / csgo-retakes-hud

Displays the current bombsite in a HUD message. This will work with all versions of the Retakes plugin.
45 stars 9 forks source link

I am using your retakes plugin but the hud is not showing. #11

Closed ghost closed 1 year ago

ghost commented 5 years ago

Hey, I am using ofir retakes plugin but the hud is not showing up I don't see any errors in the log or console

B3none commented 5 years ago

Sometimes it can depend on the client resolution, give it a go on 1920x1080. Failing that make sure that no other plugins are conflicting with the HUD.

ghost commented 5 years ago

I don't have any hud plugins and I am on 1920x1080 I tested with 2 players no one can see any hud
I even tried sm_retakes_hud_style 3 so it will say on the chat but its saying nothing

B3none commented 5 years ago

Do style 123

ghost commented 5 years ago

i already tried its doing nothing

ghost commented 5 years ago

Are you going to fix that?

B3none commented 5 years ago

Perhaps try a retrospective version, I can't reproduce your error

borzaka commented 5 years ago

I'am experiencing the same; Compiled from the current master with SourceMod v1.9.0.6281, but the HUD is not showing up nowhere even with sm_retakes_hud_style "123"

Edit: I was able to make it work, but it's not a usable way, and needs fixing: If I disable and enable all plugins, it starts to working after enabling. Otherwise not. 1st step: exec sm_warmode_on.cfg 2nd step: exec sm_warmode_off.cfg And after this, the plugin works.

Edit 2.: Some days later, not working again... even after restart server. I don't know what's happening :) Maybe the hibernating is the issue?

Maybe some race conditions, or wrong initialization?

borzaka commented 5 years ago

Any news about this issue? How can I help you to investigate this?

B3none commented 5 years ago

Have a go at compiling the plugin using the latest sourcemod version and let me know how it behaves.

borzaka commented 5 years ago

No luck; I have recompiled the plugin from source from the repo's master brench with the latest 1.9 SourceMod version: 1.9.0.6282 Nothing shows up.

B3none commented 5 years ago

Same behaviour on 1.10?

borzaka commented 5 years ago

I'am afraid to switch to a non stable version of SourceMod. I heard that it's not backwards compatible, and I have many considered old plugins on my retake servers.

So, a compatibility with 1.9 would be nice!

borzaka commented 5 years ago

I just found out the solution! It took me couple of hours to debug :D But it's worth it!

The problem: retakesEnabled = GetConVarBool(cvar_retakes_enabled); returns 0

Therefore the plugin not executes because of this check in the Event_OnRoundStart():

if (!pluginEnabled || !retakesEnabled || IsWarmup())
{
        return;
}

The handle is set in OnPluginStart(): cvar_retakes_enabled = FindConVar("sm_retakes_enabled");

And in that time, the cvar is not set by the Retakes plugin, and that's why it's return 0 (not enabled), and that's why the plugin stops, because it thinks the retakes plugin is disabled.

Solution: OnAllPluginsLoaded instead of OnPluginStart

Tested, it works.

Thanks to the SourceMod Discord community, thanks to JoinedSenses!

Edit: only the two FindConVar is needted to move the the OnAllPluginsLoaded

B3none commented 5 years ago

That's a bloody good spot! Would you like to whack in a one liner for this? :)

borzaka commented 5 years ago

I don't get that reference :( Do you mean should I open a pull request?

B3none commented 5 years ago

Yes :P