Raised This Month: $ Target: $400
 0% 

[L4D1 & L4D2] Restart Without Changelevel


Post New Thread Reply   
 
Thread Tools Display Modes
iaNanaNana
Member
Join Date: Sep 2020
Location: Two-dimensional
Old 12-10-2022 , 00:12   Re: [L4D1 & L4D2] Restart Without Changelevel
Reply With Quote #31

Quote:
Originally Posted by Silvers View Post
That crash report is from Linux, not Windows.
I know, I said not crash in my linux server, Windows neither.
iaNanaNana is offline
Mika Misori
Senior Member
Join Date: Sep 2022
Old 04-17-2023 , 16:00   Re: [L4D1 & L4D2] Restart Without Changelevel
Reply With Quote #32

Quote:
Originally Posted by iaNanaNana View Post
I know, I said not crash in my linux server, Windows neither.
It doesn't work for me. L4D2, updated linux server, scramble installed. No errors in the console. When voting to restart it just loads the first campaign map as usual.

Here my extensions and plugins:
Spoiler


Is something broken or is it a conflict with some other plugin?

Last edited by Mika Misori; 04-17-2023 at 16:01.
Mika Misori is offline
iaNanaNana
Member
Join Date: Sep 2020
Location: Two-dimensional
Old 04-24-2023 , 04:19   Re: [L4D1 & L4D2] Restart Without Changelevel
Reply With Quote #33

Quote:
Originally Posted by Mika Misori View Post
It doesn't work for me. L4D2, updated linux server, scramble installed. No errors in the console. When voting to restart it just loads the first campaign map as usual.

Here my extensions and plugins:
Spoiler


Is something broken or is it a conflict with some other plugin?
Try this version
Attached Files
File Type: zip l4d_restart_without_changelevel.zip (10.4 KB, 46 views)
iaNanaNana is offline
Mika Misori
Senior Member
Join Date: Sep 2022
Old 04-25-2023 , 03:58   Re: [L4D1 & L4D2] Restart Without Changelevel
Reply With Quote #34

Quote:
Originally Posted by iaNanaNana View Post
Try this version
This version gives an error:
Code:
<Error> "Restart Without Change Level" (1.5) by IA/NanaNana
L 04/25/2023 - 07:15:26: [SM] Exception reported: Invalid patch name RestartVersus
L 04/25/2023 - 07:15:26: [SM] Blaming: l4d_restart_without_changelevel.smx
L 04/25/2023 - 07:15:26: [SM] Call stack trace:
L 04/25/2023 - 07:15:26: [SM]   [0] MemoryPatch.CreateFromConf
L 04/25/2023 - 07:15:26: [SM]   [1] Line 88, J:\Steam\steamapps\common\left 4 dead\left4dead\addons\sourcemod\plugins\l4d_restart_without_changelevel.sp::OnPluginStart
L 04/25/2023 - 07:15:26: [SM] Unable to load plugin "l4d_restart_without_changelevel.smx": Error detected in plugin startup (see error logs)
Mika Misori is offline
iaNanaNana
Member
Join Date: Sep 2020
Location: Two-dimensional
Old 04-25-2023 , 05:33   Re: [L4D1 & L4D2] Restart Without Changelevel
Reply With Quote #35

Quote:
Originally Posted by Mika Misori View Post
This version gives an error:
Code:
<Error> "Restart Without Change Level" (1.5) by IA/NanaNana
L 04/25/2023 - 07:15:26: [SM] Exception reported: Invalid patch name RestartVersus
L 04/25/2023 - 07:15:26: [SM] Blaming: l4d_restart_without_changelevel.smx
L 04/25/2023 - 07:15:26: [SM] Call stack trace:
L 04/25/2023 - 07:15:26: [SM]   [0] MemoryPatch.CreateFromConf
L 04/25/2023 - 07:15:26: [SM]   [1] Line 88, J:\Steam\steamapps\common\left 4 dead\left4dead\addons\sourcemod\plugins\l4d_restart_without_changelevel.sp::OnPluginStart
L 04/25/2023 - 07:15:26: [SM] Unable to load plugin "l4d_restart_without_changelevel.smx": Error detected in plugin startup (see error logs)
Attached Files
File Type: zip l4d_restart_without_changelevel.zip (10.3 KB, 48 views)
iaNanaNana is offline
Mika Misori
Senior Member
Join Date: Sep 2022
Old 04-25-2023 , 06:13   Re: [L4D1 & L4D2] Restart Without Changelevel
Reply With Quote #36

Works like a charm, thank you so much!
Mika Misori is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 05-09-2023 , 14:22   Re: [L4D1 & L4D2] Restart Without Changelevel
Reply With Quote #37

Confirm this plugin does not work well in realism mode,
The problem is the function L4D_GetGameModeType() from left4dhooks (1.130)

In realism mode, L4D_GetGameModeType() return 0.
PHP Code:
    PrintToChatAll("%d"L4D_GetGameModeType()); // print 0 in realism mode, but 0 is Unknown Mode

    
else switch(L4D_GetGameModeType())
    {
        case 
GAMEMODE_COOPRestartGame(L4D2_RestartReason_MissionLost)
        case 
GAMEMODE_VERSUS:
        {
            
EngineVersion e GetEngineVersion()
            
iLastRoundNumber LoadFromAddress(L4D_GetPointer(POINTER_DIRECTOR)+view_as<Address>(m_iRoundNumber), NumberType_Int8)
            
StoreToAddress(L4D_GetPointer(POINTER_DIRECTOR)+view_as<Address>(m_iRoundNumber), == Engine_Left4Dead2 0NumberType_Int8)
            
hRestartVersus.Enable()
            
RestartGame(L4D2_RestartReason_VersusNoSwaps)
            
hRestartVersus.Disable()
        }
        default: 
RestartGame(L4D2_RestartReason_None)
    } 
so, another solution
PHP Code:
       if(L4D2_IsGenericCooperativeMode()) 
        {
            
RestartGame(L4D2_RestartReason_MissionLost);
        }
        else if(
L4D_IsVersusMode()) 
        {
            
EngineVersion e GetEngineVersion();
            
iLastRoundNumber LoadFromAddress(L4D_GetPointer(POINTER_DIRECTOR)+view_as<Address>(m_iRoundNumber), NumberType_Int8);
            
StoreToAddress(L4D_GetPointer(POINTER_DIRECTOR)+view_as<Address>(m_iRoundNumber), == Engine_Left4Dead2 0NumberType_Int8);
            
hRestartVersus.Enable();
            
RestartGame(L4D2_RestartReason_VersusNoSwaps);
            
hRestartVersus.Disable();
        }
        else
        {
            
RestartGame(L4D2_RestartReason_None);
        } 
__________________

Last edited by HarryPotter; 05-09-2023 at 14:23.
HarryPotter is offline
iaNanaNana
Member
Join Date: Sep 2020
Location: Two-dimensional
Old 05-10-2023 , 12:05   Re: [L4D1 & L4D2] Restart Without Changelevel
Reply With Quote #38

Quote:
Originally Posted by HarryPotter View Post
Confirm this plugin does not work well in realism mode,
The problem is the function L4D_GetGameModeType() from left4dhooks (1.130)

In realism mode, L4D_GetGameModeType() return 0.
PHP Code:
    PrintToChatAll("%d"L4D_GetGameModeType()); // print 0 in realism mode, but 0 is Unknown Mode

    
else switch(L4D_GetGameModeType())
    {
        case 
GAMEMODE_COOPRestartGame(L4D2_RestartReason_MissionLost)
        case 
GAMEMODE_VERSUS:
        {
            
EngineVersion e GetEngineVersion()
            
iLastRoundNumber LoadFromAddress(L4D_GetPointer(POINTER_DIRECTOR)+view_as<Address>(m_iRoundNumber), NumberType_Int8)
            
StoreToAddress(L4D_GetPointer(POINTER_DIRECTOR)+view_as<Address>(m_iRoundNumber), == Engine_Left4Dead2 0NumberType_Int8)
            
hRestartVersus.Enable()
            
RestartGame(L4D2_RestartReason_VersusNoSwaps)
            
hRestartVersus.Disable()
        }
        default: 
RestartGame(L4D2_RestartReason_None)
    } 
so, another solution
PHP Code:
       if(L4D2_IsGenericCooperativeMode()) 
        {
            
RestartGame(L4D2_RestartReason_MissionLost);
        }
        else if(
L4D_IsVersusMode()) 
        {
            
EngineVersion e GetEngineVersion();
            
iLastRoundNumber LoadFromAddress(L4D_GetPointer(POINTER_DIRECTOR)+view_as<Address>(m_iRoundNumber), NumberType_Int8);
            
StoreToAddress(L4D_GetPointer(POINTER_DIRECTOR)+view_as<Address>(m_iRoundNumber), == Engine_Left4Dead2 0NumberType_Int8);
            
hRestartVersus.Enable();
            
RestartGame(L4D2_RestartReason_VersusNoSwaps);
            
hRestartVersus.Disable();
        }
        else
        {
            
RestartGame(L4D2_RestartReason_None);
        } 
Updated, thanks.
iaNanaNana is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 05-24-2023 , 05:42   Re: [L4D1 & L4D2] Restart Without Changelevel
Reply With Quote #39

after l4d2 update

PHP Code:
L 05/24/2023 17:40:48: [SMException reportedDetourFunctions CRestartGameIssue::ExecuteCommand invalid
L 05
/24/2023 17:40:48: [SMBlamingl4d_restart_without_changelevel.smx
L 05
/24/2023 17:40:48: [SMCall stack trace:
L 05/24/2023 17:40:48: [SM]   [0SetFailState
L 05
/24/2023 17:40:48: [SM]   [1Line 85J:\IA\SourceMod\Customize\l4d_restart_without_changelevel\scripting\l4d_restart_without_changelevel.sp::OnPluginStart
L 05
/24/2023 17:40:48: [SMUnable to load plugin "l4d_restart_without_changelevel.smx"Error detected in plugin startup (see error logs
L4D2 windows server
__________________
HarryPotter is offline
iaNanaNana
Member
Join Date: Sep 2020
Location: Two-dimensional
Old 05-24-2023 , 16:19   Re: [L4D1 & L4D2] Restart Without Changelevel
Reply With Quote #40

Quote:
Originally Posted by HarryPotter View Post
after l4d2 update

PHP Code:
L 05/24/2023 17:40:48: [SMException reportedDetourFunctions CRestartGameIssue::ExecuteCommand invalid
L 05
/24/2023 17:40:48: [SMBlamingl4d_restart_without_changelevel.smx
L 05
/24/2023 17:40:48: [SMCall stack trace:
L 05/24/2023 17:40:48: [SM]   [0SetFailState
L 05
/24/2023 17:40:48: [SM]   [1Line 85J:\IA\SourceMod\Customize\l4d_restart_without_changelevel\scripting\l4d_restart_without_changelevel.sp::OnPluginStart
L 05
/24/2023 17:40:48: [SMUnable to load plugin "l4d_restart_without_changelevel.smx"Error detected in plugin startup (see error logs
L4D2 windows server
Attached Files
File Type: zip l4d_restart_without_changelevel_1.5.2.zip (10.7 KB, 50 views)

Last edited by iaNanaNana; 05-24-2023 at 16:40.
iaNanaNana 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 03:50.


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