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_SM, g_sCmdLogPath, sizeof(g_sCmdLogPath), "logs/mapchange-notimer.log");
}
public void OnMapStart() {
LogInfo("Why Is This Logged Twice?");
}
stock void LogInfo(char[] sInfo) {
LogToFileEx(g_sCmdLogPath, sInfo);
}
With Timer (executes once):
PHP Code:
char g_sCmdLogPath[255];
public void OnPluginStart() {
BuildPath(Path_SM, g_sCmdLogPath, sizeof(g_sCmdLogPath), "logs/mapchange-timer.log");
}
public void OnMapStart() {
CreateTimer(1.0, tMapStart);
}
public Action tMapStart(Handle timer) {
LogInfo("A Timer Is Only Logged Once");
}
stock void LogInfo(char[] sInfo) {
LogToFileEx(g_sCmdLogPath, sInfo);
}
__________________