void SM_ExecuteAllConfigs() { if (g_bGotServerStart) { return; } engine->ServerCommand("exec sourcemod/sourcemod.cfg\n"); IPluginIterator *iter = g_PluginSys.GetPluginIterator(); while (iter->MorePlugins()) { CPlugin *plugin = (CPlugin *)(iter->GetPlugin()); unsigned int num = plugin->GetConfigCount(); bool can_create = true; for (unsigned int i=0; i<num; i++) { can_create = SM_ExecuteConfig(plugin, plugin->GetConfig(i), can_create); } iter->NextPlugin(); } iter->Release(); g_bGotServerStart = true; CheckAndFinalizeConfigs(); }
void SM_ConfigsExecuted_Plugin(unsigned int serial) { IPluginIterator *iter = g_PluginSys.GetPluginIterator(); while (iter->MorePlugins()) { CPlugin *plugin = (CPlugin *)(iter->GetPlugin()); if (plugin->GetSerial() == serial) { SM_DoSingleExecFwds(plugin->GetBaseContext()); break; } iter->NextPlugin(); } iter->Release(); }
static cell_t MorePlugins(IPluginContext *pContext, const cell_t *params) { Handle_t hndl = (Handle_t)params[1]; HandleError err; IPluginIterator *pIter; HandleSecurity sec; sec.pIdentity = g_pCoreIdent; sec.pOwner = pContext->GetIdentity(); if ((err=handlesys->ReadHandle(hndl, g_PlIter, &sec, (void **)&pIter)) != HandleError_None) { return pContext->ThrowNativeError("Could not read Handle %x (error %d)", hndl, err); } return pIter->MorePlugins() ? 1 : 0; }
void SetOwnsItem(cell_t client,cell_t itemid,bool newownsitem){ if(itemid<(cell_t)0||itemid>=MAXITEMS){ ERR("invalid item ownership set client %d itemid %d / maxitem %d ",client,itemid ,MAXITEMS); } else{ //ERR("1r"); playersownershipobj[client].item[itemid]=newownsitem; IPluginIterator *iterator = g->pluginmanager->GetPluginIterator(); //ERR("iter"); while(iterator->MorePlugins()){ IPlugin* plugin=iterator->GetPlugin(); IPluginFunction *func=plugin->GetRuntime()->GetFunctionByName(newownsitem?"OnItem2Purchase":"OnItem2Lost"); if(func!=NULL){ cell_t myparams[2]; myparams[0]=client; myparams[1]=itemid; //ERR("call"); func->CallFunction(myparams,2,&dummy); } iterator->NextPlugin(); } } }