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

Function sm_SetEventFloat

core/smn_events.cpp:379–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379static cell_t sm_SetEventFloat(IPluginContext *pContext, const cell_t *params)
380{
381 Handle_t hndl = static_cast<Handle_t>(params[1]);
382 HandleError err;
383 EventInfo *pInfo;
384 HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
385
386 if ((err=handlesys->ReadHandle(hndl, g_EventManager.GetHandleType(), &sec, (void **)&pInfo))
387 != HandleError_None)
388 {
389 return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err);
390 }
391
392 char *key;
393 pContext->LocalToString(params[2], &key);
394
395 float value = sp_ctof(params[3]);
396 pInfo->pEvent->SetFloat(key, value);
397
398 return 1;
399}
400
401static cell_t sm_SetEventString(IPluginContext *pContext, const cell_t *params)
402{

Callers

nothing calls this directly

Calls 4

GetHandleTypeMethod · 0.80
GetIdentityMethod · 0.45
ReadHandleMethod · 0.45
SetFloatMethod · 0.45

Tested by

no test coverage detected