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

Function smn_KvSetFloat

core/smn_keyvalues.cpp:236–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236static cell_t smn_KvSetFloat(IPluginContext *pCtx, const cell_t *params)
237{
238 Handle_t hndl = static_cast<Handle_t>(params[1]);
239 HandleError herr;
240 HandleSecurity sec;
241 KeyValueStack *pStk;
242
243 sec.pOwner = NULL;
244 sec.pIdentity = g_pCoreIdent;
245
246 if ((herr=handlesys->ReadHandle(hndl, g_KeyValueType, &sec, (void **)&pStk))
247 != HandleError_None)
248 {
249 return pCtx->ThrowNativeError("Invalid key value handle %x (error %d)", hndl, herr);
250 }
251
252 char *key;
253 pCtx->LocalToStringNULL(params[2], &key);
254
255 pStk->pCurRoot.front()->SetFloat(key, sp_ctof(params[3]));
256
257 return 1;
258}
259
260static cell_t smn_KvSetColor(IPluginContext *pCtx, const cell_t *params)
261{

Callers

nothing calls this directly

Calls 2

ReadHandleMethod · 0.45
SetFloatMethod · 0.45

Tested by

no test coverage detected