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

Function sm_GetCmdArg

core/smn_console.cpp:842–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

840}
841
842static cell_t sm_GetCmdArg(IPluginContext *pContext, const cell_t *params)
843{
844 const ICommandArgs *pCmd = g_HL2.PeekCommandStack();
845
846 if (!pCmd)
847 {
848 return pContext->ThrowNativeError("No command callback available");
849 }
850
851 size_t length;
852
853 const char *arg = pCmd->Arg(params[1]);
854
855 pContext->StringToLocalUTF8(params[2], params[3], arg ? arg : "", &length);
856
857 return (cell_t)length;
858}
859
860static cell_t sm_GetCmdArgString(IPluginContext *pContext, const cell_t *params)
861{

Callers

nothing calls this directly

Calls 2

PeekCommandStackMethod · 0.80
ArgMethod · 0.45

Tested by

no test coverage detected