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

Function smn_KvSetString

core/smn_keyvalues.cpp:159–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159static cell_t smn_KvSetString(IPluginContext *pCtx, const cell_t *params)
160{
161 Handle_t hndl = static_cast<Handle_t>(params[1]);
162 HandleError herr;
163 HandleSecurity sec;
164 KeyValueStack *pStk;
165
166 sec.pOwner = NULL;
167 sec.pIdentity = g_pCoreIdent;
168
169 if ((herr=handlesys->ReadHandle(hndl, g_KeyValueType, &sec, (void **)&pStk))
170 != HandleError_None)
171 {
172 return pCtx->ThrowNativeError("Invalid key value handle %x (error %d)", hndl, herr);
173 }
174
175 char *key, *value;
176 pCtx->LocalToStringNULL(params[2], &key);
177 pCtx->LocalToString(params[3], &value);
178
179 pStk->pCurRoot.front()->SetString(key, value);
180
181 return 1;
182}
183
184static cell_t smn_KvSetNum(IPluginContext *pCtx, const cell_t *params)
185{

Callers

nothing calls this directly

Calls 2

ReadHandleMethod · 0.45
SetStringMethod · 0.45

Tested by

no test coverage detected