diff --git a/code/components/citizen-server-impl/src/state/ServerGameState.cpp b/code/components/citizen-server-impl/src/state/ServerGameState.cpp index 818444154e..aada8b0186 100644 --- a/code/components/citizen-server-impl/src/state/ServerGameState.cpp +++ b/code/components/citizen-server-impl/src/state/ServerGameState.cpp @@ -3269,7 +3269,21 @@ auto ServerGameState::CreateEntityFromTree(sync::NetObjEntityType type, const st { std::unique_lock entitiesByIdLock(m_entitiesByIdMutex); m_entitiesById[id] = entity; - } + } + + const auto evComponent = m_instance->GetComponent()->GetComponent(); + + /*NETEV serverEntityCreated SERVER + /#* + * A server-side event that is triggered when an entity has been created by a server-side script. + * + * Unlike "entityCreated" the newly created entity may not yet have an assigned network owner. + * + * @param entity - The created entity handle. + #/ + declare function serverEntityCreated(handle: number): void; + */ + evComponent->QueueEvent2("serverEntityCreated", { }, MakeScriptHandle(entity)); return entity; }