PDA

View Full Version : Forwards call order


seekenz
03-26-2015, 09:23
Can someone tell me what is the order of calling events when server starts?

There are
forward void OnMapStart();
forward APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max);
forward void OnPluginStart();
forward void OnAllPluginsLoaded();
forward void OnConfigsExecuted();

Could someone put it in correct order? ;)

_AeonOne_
03-26-2015, 09:39
AskPluginLoad2
OnPluginStart
OnAllPluginsLoaded
OnMapStart
OnConfigsExecuted

Tested with this small simple script:

#pragma semicolon 1

public APLRes AskPluginLoad2(Handle self, bool late, char[] error, int err_max)
{
PrintToServer("Ask Load");
}

public void OnPluginStart()
{
PrintToServer("Plugin Start");
}

public void OnAllPluginsLoaded()
{
PrintToServer("All Plugins loaded");
}

public void OnMapStart()
{
PrintToServer("Map Start");
}

public void OnConfigsExecuted()
{
PrintToServer("Cfgs exec");
}

Chdata
03-26-2015, 09:41
#include <sourcemod>
int g_iGlobal = 0;

public void OnMapStart() ed("OnMapStart");
public APLRes AskPluginLoad2(Handle what, bool in, char[] the, int world) ed("AskPluginLoad2");
public void OnPluginStart() ed("OnPluginStart");
public void OnAllPluginsLoaded() ed("OnAllPluginsLoaded");
public void OnConfigsExecuted() ed("OnConfigsExecuted");

void ed(char[] data) LogMessage("%s %i", data, ++g_iGlobal);

Ninja'd

Mitchell
03-26-2015, 10:37
#include <sourcemod>
int g_iGlobal = 0;

public void OnMapStart() ed();
public APLRes AskPluginLoad2(Handle what, bool in, char[] the, int world) ed();
public void OnPluginStart() ed();
public void OnAllPluginsLoaded() ed();
public void OnConfigsExecuted() ed();

void ed() LogMessage("ORDER %i", ++g_iGlobal);

Ninja'd
uhhhh
i feel like that wouldn't really help at all, just print out
ORDER: 1
ORDER: 2
ORDER: 3
ORDER: 4
ORDER: 5

seekenz
03-26-2015, 10:43
_AeonOne_ thank you very much

Chdata
03-26-2015, 14:13
oh yeah lolmao