diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index 3b9efe01..92694e22 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -929,7 +929,16 @@ static cell_t CreateEntityByName(IPluginContext *pContext, const cell_t *params) char *classname; pContext->LocalToString(params[1], &classname); +#if SOURCE_ENGINE != SE_CSGO CBaseEntity *pEntity = (CBaseEntity *)servertools->CreateEntityByName(classname); +#else + CBaseEntity *pEntity = (CBaseEntity *)servertools->CreateItemEntityByName(classname); + + if(!pEntity) + { + pEntity = (CBaseEntity *)servertools->CreateEntityByName(classname); + } +#endif return gamehelpers->EntityToBCompatRef(pEntity); } #else