MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / OnPluginStart

Method OnPluginStart

core/logic/PluginSys.cpp:354–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354bool CPlugin::OnPluginStart()
355{
356 m_EnteredSecondPass = true;
357
358 if (m_status != Plugin_Loaded)
359 return false;
360 m_status = Plugin_Running;
361
362 SyncMaxClients(playerhelpers->GetMaxClients());
363
364 cell_t result;
365 IPluginFunction *pFunction = m_pRuntime->GetFunctionByName("OnPluginStart");
366 if (!pFunction)
367 return true;
368
369 int err;
370 if ((err=pFunction->Execute(&result)) != SP_ERROR_NONE) {
371 EvictWithError(Plugin_Error, "Error detected in plugin startup (see error logs)");
372 return false;
373 }
374 return true;
375}
376
377void CPlugin::Call_OnPluginEnd()
378{

Callers 1

RunSecondPassMethod · 0.80

Calls 2

GetMaxClientsMethod · 0.80
ExecuteMethod · 0.45

Tested by

no test coverage detected