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

Function GetEntityNetClass

core/smn_entities.cpp:432–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432static cell_t GetEntityNetClass(IPluginContext *pContext, const cell_t *params)
433{
434 CBaseEntity *pEntity = g_HL2.ReferenceToEntity(params[1]);
435
436 IServerUnknown *pUnk = (IServerUnknown *)pEntity;
437
438 if (!pEntity)
439 {
440 return pContext->ThrowNativeError("Invalid entity (%d - %d)", g_HL2.ReferenceToIndex(params[1]), params[1]);
441 }
442
443 ServerClass *pClass = g_HL2.FindEntityServerClass(pEntity);
444 if (!pClass)
445 {
446 return 0;
447 }
448
449 pContext->StringToLocal(params[2], params[3], pClass->GetName());
450
451 return 1;
452}
453
454static cell_t GetEntData(IPluginContext *pContext, const cell_t *params)
455{

Callers

nothing calls this directly

Calls 4

ReferenceToEntityMethod · 0.80
ReferenceToIndexMethod · 0.80
FindEntityServerClassMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected