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

Method FindPluginByConsoleArg

core/logic/PluginSys.cpp:2230–2257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2228}
2229
2230SMPlugin *CPluginManager::FindPluginByConsoleArg(const char *arg)
2231{
2232 int id;
2233 char *end;
2234 CPlugin *pl;
2235
2236 id = strtol(arg, &end, 10);
2237
2238 if (*end == '\0')
2239 {
2240 pl = GetPluginByOrder(id);
2241 if (!pl)
2242 {
2243 return NULL;
2244 }
2245 }
2246 else
2247 {
2248 char pluginfile[256];
2249 const char *ext = libsys->GetFileExtension(arg) ? "" : ".smx";
2250 ke::SafeSprintf(pluginfile, sizeof(pluginfile), "%s%s", arg, ext);
2251
2252 if (!m_LoadLookup.retrieve(pluginfile, &pl))
2253 return NULL;
2254 }
2255
2256 return pl;
2257}
2258
2259void CPluginManager::OnSourceModMaxPlayersChanged(int newvalue)
2260{

Callers 2

OnRootConsoleCommandMethod · 0.80
OnRootConsoleCommandMethod · 0.80

Calls 2

GetFileExtensionMethod · 0.80
retrieveMethod · 0.45

Tested by

no test coverage detected