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

Function sm_SetEventString

core/smn_events.cpp:401–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401static cell_t sm_SetEventString(IPluginContext *pContext, const cell_t *params)
402{
403 Handle_t hndl = static_cast<Handle_t>(params[1]);
404 HandleError err;
405 EventInfo *pInfo;
406 HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
407
408 if ((err=handlesys->ReadHandle(hndl, g_EventManager.GetHandleType(), &sec, (void **)&pInfo))
409 != HandleError_None)
410 {
411 return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err);
412 }
413
414 char *key, *value;
415 pContext->LocalToString(params[2], &key);
416 pContext->LocalToString(params[3], &value);
417
418 pInfo->pEvent->SetString(key, value);
419
420 return 1;
421}
422
423static cell_t sm_SetEventBroadcast(IPluginContext *pContext, const cell_t *params)
424{

Callers

nothing calls this directly

Calls 4

GetHandleTypeMethod · 0.80
GetIdentityMethod · 0.45
ReadHandleMethod · 0.45
SetStringMethod · 0.45

Tested by

no test coverage detected