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

Function sm_GetCommandLineParam

core/smn_commandline.cpp:55–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55static cell_t sm_GetCommandLineParam(IPluginContext *pCtx, const cell_t *params)
56{
57 ICommandLine *pCmdLine = g_HL2.GetValveCommandLine();
58
59 if (pCmdLine == NULL)
60 {
61 return pCtx->ThrowNativeError("Unable to get valve command line");
62 }
63
64 char *param = NULL;
65 char *defValue = NULL;
66 pCtx->LocalToString(params[1], &param);
67 pCtx->LocalToString(params[4], &defValue);
68
69 const char *value = pCmdLine->ParmValue(param, defValue);
70
71 pCtx->StringToLocal(params[2], params[3], value);
72
73 return 1;
74}
75
76static cell_t sm_GetCommandLineParamInt(IPluginContext *pCtx, const cell_t *params)
77{

Callers

nothing calls this directly

Calls 1

GetValveCommandLineMethod · 0.80

Tested by

no test coverage detected