Raised This Month: $32 Target: $400
 8% 

Solved [request] [L4D2] Tankhud Panel Enhanced


Post New Thread Reply   
 
Thread Tools Display Modes
Tank Rush
Senior Member
Join Date: May 2019
Location: Argentina
Old 06-29-2021 , 21:44   Re: [request] [L4D2] Tankhud Panel Enhanced
Reply With Quote #11

Sorry, I forgot this post. Here you go but it is in Spanish, you can find the include files and everything you need in this GitHub repository:
https://github.com/Attano/L4D2-Competitive-Framework
https://github.com/SirPlease/L4D2-Competitive-Rework

Thank you!
  • foxhound27 - for supporting this plugin
  • V1SoR - for creating the original plugin
Attached Files
File Type: sp Get Plugin or Get Source (thsource.sp - 241 views - 18.4 KB)
__________________
Sorry i don't speak english very well

--->My name is Source and I'm on Steam<---
Discord: Source#9382

Last edited by Tank Rush; 07-11-2021 at 09:38.
Tank Rush is offline
Hawkins
Senior Member
Join Date: Jul 2021
Old 07-26-2021 , 15:20   Re: [request] [L4D2] Tankhud Panel Enhanced
Reply With Quote #12

Where to put the .inc files?
Hawkins is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 07-26-2021 , 15:23   Re: [request] [L4D2] Tankhud Panel Enhanced
Reply With Quote #13

Quote:
Originally Posted by Hawkins View Post
Where to put the .inc files?
Code:
addons/sourcemod/scripting/include/<put .inc files here>
__________________
Psyk0tik is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 10-19-2021 , 12:38   Re: [request] [L4D2] Tankhud Panel Enhanced
Reply With Quote #14

Code:
L 09/26/2021 - 18:55:19: [SM] Exception reported: Memory leak
L 09/26/2021 - 18:55:19: [SM] Exception reported: Error creating ThisHandle in preparation to call hook callback. (error 6)
L 09/26/2021 - 18:55:19: [SM] Blaming: left4dhooks.smx::SelectTankAttack
L 09/26/2021 - 18:55:19: [SM] MEMORY LEAK DETECTED IN PLUGIN (file "tankhud.smx")
L 09/26/2021 - 18:55:19: [SM] Unloading plugin to free 31396 handles.
L 09/26/2021 - 18:55:19: [SM] Contact the author(s) of this plugin to correct this error.
L 09/26/2021 - 18:55:19: --------------------------------------------------------------------------
L 09/26/2021 - 18:55:19: Type IMenuPanel | Count 31390
L 09/26/2021 - 18:55:19: Type GameConfigs | Count 1
L 09/26/2021 - 18:55:19: Type Timer | Count 1
L 09/26/2021 - 18:55:19: Type Trie | Count 3
L 09/26/2021 - 18:55:19: Type ValveCall | Count 1
L 09/26/2021 - 18:55:19: --------------------------------------------------------------------------
L 09/26/2021 - 18:55:19: Oldest Living Handle: Timer created at 09/24/2021 - 01:02:52
L 09/26/2021 - 18:55:19: Newest Living Handle: IMenuPanel created at 09/26/2021 - 18:55:17
L 09/26/2021 - 18:55:19: -- Approximately 882076 bytes of memory are in use by (31396) Handles.

L 09/26/2021 - 18:55:19: [SM] Exception reported: Memory leak
L 09/26/2021 - 18:55:19: [SM] Exception reported: Error creating ThisHandle in preparation to call hook callback. (error 6)
L 09/26/2021 - 18:55:19: [SM] Blaming: left4dhooks.smx::SelectTankAttackPre
L 09/26/2021 - 18:55:19: [SM] MEMORY LEAK DETECTED IN PLUGIN (file "tankhud.smx")
L 09/26/2021 - 18:55:19: [SM] Unloading plugin to free 31396 handles.
L 09/26/2021 - 18:55:19: [SM] Contact the author(s) of this plugin to correct this error.
L 09/26/2021 - 18:55:19: --------------------------------------------------------------------------
L 09/26/2021 - 18:55:19: Type IMenuPanel | Count 31390
L 09/26/2021 - 18:55:19: Type GameConfigs | Count 1
L 09/26/2021 - 18:55:19: Type Timer | Count 1
L 09/26/2021 - 18:55:19: Type Trie | Count 3
L 09/26/2021 - 18:55:19: Type ValveCall | Count 1
L 09/26/2021 - 18:55:19: --------------------------------------------------------------------------
L 09/26/2021 - 18:55:19: Oldest Living Handle: Timer created at 09/24/2021 - 01:02:52
L 09/26/2021 - 18:55:19: Newest Living Handle: IMenuPanel created at 09/26/2021 - 18:55:17
L 09/26/2021 - 18:55:19: -- Approximately 882076 bytes of memory are in use by (31396) Handles.
JLmelenchon is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 10-19-2021 , 15:32   Re: [request] [L4D2] Tankhud Panel Enhanced
Reply With Quote #15

Probably a memory weak from opening multiple Menus but not releasing the Handle (menu)

Seems that DummySpecHudHandler / DummyTankHudHandler doesn't delete the handle on action "End"

Didn't test buy maybe changing

PHP Code:
public DummySpecHudHandler(Handle:hMenuMenuAction:actionparam1param2) {}
public 
DummyTankHudHandler(Handle:hMenuMenuAction:actionparam1param2) {} 
to:

PHP Code:
public int DummySpecHudHandler(Menu menuMenuAction actionint param1int param2)
{
    switch (
action)
    {
        case 
MenuAction_End:
        {
            
delete menu;
        }
    }

    return 
0;
}

public 
int DummyTankHudHandler(Menu menuMenuAction actionint param1int param2)
{
    switch (
action)
    {
        case 
MenuAction_End:
        {
            
delete menu;
        }
    }

    return 
0;

would fix it.
__________________
Marttt is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 10-19-2021 , 19:50   Re: [request] [L4D2] Tankhud Panel Enhanced
Reply With Quote #16

Ok nice i will try.
JLmelenchon is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 10-23-2021 , 19:37   Re: [request] [L4D2] Tankhud Panel Enhanced
Reply With Quote #17

Still not.

Code:
L 10/23/2021 - 21:55:24: [SM] MEMORY LEAK DETECTED IN PLUGIN (file "tankhud.smx")
L 10/23/2021 - 21:55:24: [SM] Unloading plugin to free 31243 handles.
L 10/23/2021 - 21:55:24: [SM] Contact the author(s) of this plugin to correct this error.
L 10/23/2021 - 21:55:24: --------------------------------------------------------------------------
L 10/23/2021 - 21:55:24: Type	IMenuPanel          |	Count	31238
L 10/23/2021 - 21:55:24: Type	GameConfigs         |	Count	1
L 10/23/2021 - 21:55:24: Type	Timer               |	Count	1
L 10/23/2021 - 21:55:24: Type	Trie                |	Count	3
L 10/23/2021 - 21:55:24: --------------------------------------------------------------------------
L 10/23/2021 - 21:55:24: Oldest Living Handle: Timer created at 10/21/2021 - 06:54:11
L 10/23/2021 - 21:55:24: Newest Living Handle: IMenuPanel created at 10/23/2021 - 21:55:05
L 10/23/2021 - 21:55:24: -- Approximately 877820 bytes of memory are in use by (31243) Handles.

L 10/23/2021 - 21:55:24: [SM] Exception reported: Memory leak
L 10/23/2021 - 22:03:43: Error log file session closed.
But is it problematic ? If the plugin got unloaded anyway.

Last edited by JLmelenchon; 10-23-2021 at 19:39.
JLmelenchon is offline
dustinandband
Senior Member
Join Date: May 2015
Old 10-23-2021 , 20:14   Re: [request] [L4D2] Tankhud Panel Enhanced
Reply With Quote #18

After a quick 2 minute search:

PHP Code:
new Handle:tankHud CreatePanel();
if (!
FillTankInfo(tankHudtrue)) // No tank -- no HUD
    
return Plugin_Handled
Handle tankHud gets created in a continuous loop and never gets freed since you need to close the handle before returning Plugin_Handled.
dustinandband is offline
JLmelenchon
Senior Member
Join Date: Mar 2019
Old 10-24-2021 , 19:38   Re: [request] [L4D2] Tankhud Panel Enhanced
Reply With Quote #19

What should i add?
JLmelenchon is offline
dustinandband
Senior Member
Join Date: May 2015
Old 10-25-2021 , 15:57   Re: [request] [L4D2] Tankhud Panel Enhanced
Reply With Quote #20

Quote:
Originally Posted by JLmelenchon View Post
What should i add?
Odd that the competitive framework version has the same return without closing the handle, but go ahead and try this

PHP Code:
public Action:HudDrawTimer(Handle:hTimer
{
    if (
IsInReady() || IsInPause())
        return 
Plugin_Handled;

    new 
bool:bSpecsOnServer false;
    for (new 
1<= MaxClientsi++) 
    {
        if (
IsSpectator(i))
        {
            
bSpecsOnServer true;
            break;
        }
    }

    if (
bSpecsOnServer// Only bother if someone's watching us
    
{
        new 
Handle:specHud CreatePanel();

        
FillHeaderInfo(specHud);
        
FillSurvivorInfo(specHud);
        
FillInfectedInfo(specHud);
        
FillTankInfo(specHud);
        
FillGameInfo(specHud);

        for (new 
1<= MaxClientsi++) 
        {
            if (!
bSpecHudActive[i] || !IsSpectator(i) || IsFakeClient(i))
                continue;

            
SendPanelToClient(specHudiDummySpecHudHandler3);
            if (!
bSpecHudHintShown[i])
            {
                
bSpecHudHintShown[i] = true;
                
CPrintToChat(i"<{olive}HUD{default}> Escriba {green}!spechud{default} en el chat para alternar el {blue}Espectador HUD{default}.");
            }
        }

        
CloseHandle(specHud);
    }
    
    new 
Handle:tankHud CreatePanel();
    if (
FillTankInfo(tankHudtrue))
    {
        for (new 
1<= MaxClientsi++) 
        {
            if (!
bTankHudActive[i] || !IsClientInGame(i) || IsFakeClient(i) || IsSurvivor(i) || (bSpecHudActive[i] && IsSpectator(i)))
                continue;

            
SendPanelToClient(tankHudiDummyTankHudHandler3);
            if (!
bTankHudHintShown[i])
            {
                
bTankHudHintShown[i] = true;
                
CPrintToChat(i"<{olive}HUD{default}> Escriba {green}!tankhud{default} en el chat para alternar el {red}Tank HUD{default}.");
            }
        }
    }
    
CloseHandle(tankHud);
    return 
Plugin_Continue;

dustinandband is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode