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

Function sm_GetConVarFloat

core/smn_console.cpp:392–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392static cell_t sm_GetConVarFloat(IPluginContext *pContext, const cell_t *params)
393{
394 Handle_t hndl = static_cast<Handle_t>(params[1]);
395 HandleError err;
396 ConVar *pConVar;
397
398 if ((err=g_ConVarManager.ReadConVarHandle(hndl, &pConVar))
399 != HandleError_None)
400 {
401 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
402 }
403
404 float value = pConVar->GetFloat();
405
406 return sp_ftoc(value);
407}
408
409static cell_t sm_SetConVarFloat(IPluginContext *pContext, const cell_t *params)
410{

Callers

nothing calls this directly

Calls 2

ReadConVarHandleMethod · 0.80
GetFloatMethod · 0.45

Tested by

no test coverage detected