View Single Post
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