mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 10:28:34 +00:00
Add support for CreateItemEntityByName for CS:GO
This commit is contained in:
parent
c62a3b724b
commit
cf633f74a4
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user