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

OnMapStart() Executing Twice?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
scorpius2k1
Senior Member
Join Date: Feb 2016
Old 01-12-2020 , 19:12   OnMapStart() Executing Twice?
Reply With Quote #1

Is there a reason why when running this plugin, the entry I have in 'OnMapStart' is executed twice? If you open the log file it generates (../logs/mapchange-notimer.log), you can see a double entry each time on a new map. Oddly enough, putting a Timer via OnMapStart() it only executes once.

Am I misunderstanding something here why this is happening?

This was tested on an HL2DM Linux Server.

Thanks!

Without Timer (executes twice?) :
PHP Code:
char g_sCmdLogPath[255];

public 
void OnPluginStart() {
    
BuildPath(Path_SMg_sCmdLogPathsizeof(g_sCmdLogPath), "logs/mapchange-notimer.log");
}

public 
void OnMapStart() {
    
LogInfo("Why Is This Logged Twice?");
}

stock void LogInfo(char[] sInfo) {
    
LogToFileEx(g_sCmdLogPathsInfo);

With Timer (executes once):
PHP Code:
char g_sCmdLogPath[255];

public 
void OnPluginStart() {
    
BuildPath(Path_SMg_sCmdLogPathsizeof(g_sCmdLogPath), "logs/mapchange-timer.log");
}

public 
void OnMapStart() {
    
CreateTimer(1.0tMapStart);
}

public 
Action tMapStart(Handle timer) {
    
LogInfo("A Timer Is Only Logged Once");
}

stock void LogInfo(char[] sInfo) {
    
LogToFileEx(g_sCmdLogPathsInfo);

__________________
{__ PIRATES COVE __} ● HIGH-KILL Community | Stats ●
Half-Life 2: Deathmatch
66.151.244.149:27016 => CONNECT

Last edited by scorpius2k1; 01-12-2020 at 19:17.
scorpius2k1 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 08:18.


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