Raised This Month: $12 Target: $400
 3% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter6272
Senior Member
Join Date: Jun 2015
Location: Don't know
Old 09-19-2018 , 02:49   [CSGO] Is it possible to unload a plugin before mapchange?
Reply With Quote #1

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?
__________________
Patience is the key to success.
Hunter6272 is offline
Cruze
Veteran Member
Join Date: May 2017
Old 09-19-2018 , 04:10   Re: [CSGO] Is it possible to unload a plugin before mapchange?
Reply With Quote #2

Using timelimit or maxrounds?
__________________
Taking paid private requests! Contact me
Cruze is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 09-19-2018 , 04:22   Re: [CSGO] Is it possible to unload a plugin before mapchange?
Reply With Quote #3

You can use the event "cs_win_panel_match" that occur a few seconds before the map end.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 09-19-2018 at 04:25.
Franc1sco is offline
Send a message via MSN to Franc1sco
Hunter6272
Senior Member
Join Date: Jun 2015
Location: Don't know
Old 09-19-2018 , 09:24   Re: [CSGO] Is it possible to unload a plugin before mapchange?
Reply With Quote #4

Quote:
Originally Posted by Franc1sco View Post
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.
__________________
Patience is the key to success.
Hunter6272 is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 09-19-2018 , 10:18   Re: [CSGO] Is it possible to unload a plugin before mapchange?
Reply With Quote #5

Quote:
Originally Posted by Hunter6272 View Post
I require it for 2 events :

1. Before the map end.

2. If map is changed by admin using sm_map.
Here you go

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

__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 09-19-2018 , 14:27   Re: [CSGO] Is it possible to unload a plugin before mapchange?
Reply With Quote #6

Quote:
Originally Posted by Hunter6272 View Post
... 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.
__________________
coding & free software
shanapu is offline
Hunter6272
Senior Member
Join Date: Jun 2015
Location: Don't know
Old 09-19-2018 , 22:07   Re: [CSGO] Is it possible to unload a plugin before mapchange?
Reply With Quote #7

Quote:
Originally Posted by shanapu View Post
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.."
__________________
Patience is the key to success.
Hunter6272 is offline
dustinandband
Senior Member
Join Date: May 2015
Old 09-19-2018 , 22:11   Re: [CSGO] Is it possible to unload a plugin before mapchange?
Reply With Quote #8

Are they posted somewhere publicly? Or private? Would you be willing to post them on this thread?
dustinandband is offline
Hunter6272
Senior Member
Join Date: Jun 2015
Location: Don't know
Old 09-19-2018 , 22:49   Re: [CSGO] Is it possible to unload a plugin before mapchange?
Reply With Quote #9

Quote:
Originally Posted by Franc1sco View Post
Here you go

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)
__________________
Patience is the key to success.
Hunter6272 is offline
Hunter6272
Senior Member
Join Date: Jun 2015
Location: Don't know
Old 09-20-2018 , 12:28   Re: [CSGO] Is it possible to unload a plugin before mapchange?
Reply With Quote #10

Quote:
Originally Posted by Franc1sco View Post
Here you go

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)
__________________
Patience is the key to success.
Hunter6272 is offline
Reply


Thread Tools
Display Modes

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 21:23.


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