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

Function sm_GetConVarInt

core/smn_console.cpp:345–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345static cell_t sm_GetConVarInt(IPluginContext *pContext, const cell_t *params)
346{
347 Handle_t hndl = static_cast<Handle_t>(params[1]);
348 HandleError err;
349 ConVar *pConVar;
350
351 if ((err=g_ConVarManager.ReadConVarHandle(hndl, &pConVar))
352 != HandleError_None)
353 {
354 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
355 }
356
357 return pConVar->GetInt();
358}
359
360/* This handles both SetConVarBool() and SetConVarInt() */
361static cell_t sm_SetConVarNum(IPluginContext *pContext, const cell_t *params)

Callers

nothing calls this directly

Calls 2

ReadConVarHandleMethod · 0.80
GetIntMethod · 0.45

Tested by

no test coverage detected