AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [CSGO] Is it possible to unload a plugin before mapchange? (https://forums.alliedmods.net/showthread.php?t=310759)

Hunter6272 09-19-2018 02:49

[CSGO] Is it possible to unload a plugin before mapchange?
 
As the title says , is it possible to unload a plugin before mapchanges at endmap? There is a plugin which crashes the server on mapchange if working with the other before mapchange so on hard unload before mapchange , it doesn't crashes. If its possible , can someone share a coding example?

Cruze 09-19-2018 04:10

Re: [CSGO] Is it possible to unload a plugin before mapchange?
 
Using timelimit or maxrounds?

Franc1sco 09-19-2018 04:22

Re: [CSGO] Is it possible to unload a plugin before mapchange?
 
You can use the event "cs_win_panel_match" that occur a few seconds before the map end.

Hunter6272 09-19-2018 09:24

Re: [CSGO] Is it possible to unload a plugin before mapchange?
 
Quote:

Originally Posted by Franc1sco (Post 2615810)
You can use the event "cs_win_panel_match" that occur a few seconds before the map end.

I require it for 2 events :

1. Before the map end.

2. If map is changed by admin using sm_map.

Franc1sco 09-19-2018 10:18

Re: [CSGO] Is it possible to unload a plugin before mapchange?
 
Quote:

Originally Posted by Hunter6272 (Post 2615845)
I require it for 2 events :

1. Before the map end.

2. If map is changed by admin using sm_map.

Here you go :wink:

PHP Code:

#include <sourcemod>
#include <sdktools>

public void OnPluginStart()
{
    
HookEvent("cs_win_panel_match"Event_End);
}

public 
Action OnLogAction(Handle sourceIdentity ident,int client,int target, const char[] message)
{
    if( 
StrContainsmessage "changed map to" ) != -1)
    {
        
// On map change with sm_map command
    
}
}

public 
void Event_End(Event event, const char[] namebool dontBroadcast)
{
    
// On map end



shanapu 09-19-2018 14:27

Re: [CSGO] Is it possible to unload a plugin before mapchange?
 
Quote:

Originally Posted by Hunter6272 (Post 2615807)
... There is a plugin which crashes the server on mapchange ...

I really recommend to find a way/a person/the original author, to fix the plugin which crash servers on mapchange. Instead of ignoring the real problem and packing a workaround into it.

Hunter6272 09-19-2018 22:07

Re: [CSGO] Is it possible to unload a plugin before mapchange?
 
Quote:

Originally Posted by shanapu (Post 2615898)
I really recommend to find a way/a person/the original author, to fix the plugin which crash servers on mapchange. Instead of ignoring the real problem and packing a workaround into it.

Well one of them is inactive whose plugin no one wants to touch as its a real mess... the other one is busy and doesn't wants to touch his own plugin or the other person's plugin either :(
I showed this problem to 7 SourceMod Plugin Developers and they all rejected the request by saying "I don't have time to put my head in this.."

dustinandband 09-19-2018 22:11

Re: [CSGO] Is it possible to unload a plugin before mapchange?
 
Are they posted somewhere publicly? Or private? Would you be willing to post them on this thread?

Hunter6272 09-19-2018 22:49

Re: [CSGO] Is it possible to unload a plugin before mapchange?
 
Quote:

Originally Posted by Franc1sco (Post 2615861)
Here you go :wink:

PHP Code:

#include <sourcemod>
#include <sdktools>

public void OnPluginStart()
{
    
HookEvent("cs_win_panel_match"Event_End);
}

public 
Action OnLogAction(Handle sourceIdentity ident,int client,int target, const char[] message)
{
    if( 
StrContainsmessage "changed map to" ) != -1)
    {
        
// On map change with sm_map command
    
}
}

public 
void Event_End(Event event, const char[] namebool dontBroadcast)
{
    
// On map end



Perfect. This is working .
Can you make this a reverse of mapconfigs?
Example : Mapconfigs executes a config on mapload, Can you share a coding example with the above to execute commands before mapchange (specific map) ?
Example : If nextmap = de_dust2 , before mapchange(execute commands) , if sm_map = de_dust2 , before mapchange(execute commands)

Hunter6272 09-20-2018 12:28

Re: [CSGO] Is it possible to unload a plugin before mapchange?
 
Quote:

Originally Posted by Franc1sco (Post 2615861)
Here you go :wink:

PHP Code:

#include <sourcemod>
#include <sdktools>

public void OnPluginStart()
{
    
HookEvent("cs_win_panel_match"Event_End);
}

public 
Action OnLogAction(Handle sourceIdentity ident,int client,int target, const char[] message)
{
    if( 
StrContainsmessage "changed map to" ) != -1)
    {
        
// On map change with sm_map command
    
}
}

public 
void Event_End(Event event, const char[] namebool dontBroadcast)
{
    
// On map end



This is not working on rtv (instant mapchange) and /rcon map (rcon map change through console or any other way) :(


All times are GMT -4. The time now is 05:08.

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