| 377 | } |
| 378 | |
| 379 | static 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 | |
| 401 | static cell_t sm_SetEventString(IPluginContext *pContext, const cell_t *params) |
| 402 | { |
nothing calls this directly
no test coverage detected