<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=EntityCreated</id>
	<title>EntityCreated - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=EntityCreated"/>
	<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=EntityCreated&amp;action=history"/>
	<updated>2026-07-24T19:37:23Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://rage.grandroleplay.ru/index.php?title=EntityCreated&amp;diff=1060&amp;oldid=prev</id>
		<title>imported&gt;Pietrodc0: /* See also */</title>
		<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=EntityCreated&amp;diff=1060&amp;oldid=prev"/>
		<updated>2024-09-08T17:15:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;See also&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This event is triggered when an Entity Is Created. From my testing, this event is only accessible on the serverside.&lt;br /&gt;
&lt;br /&gt;
{{ServersideCsJsEvent}}&lt;br /&gt;
&lt;br /&gt;
{{JSContainer|&lt;br /&gt;
{{Parameters}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;entity&amp;#039;&amp;#039;&amp;#039;: {{RageType|Entity}} - the [[:Category:Entity API|entity]] that was created&lt;br /&gt;
&lt;br /&gt;
{{Example}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function entityCreatedHandler(entity) {&lt;br /&gt;
  console.log(`An Entity with the ID of ${entity.id} was created at ${entity.position}`);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
mp.events.add(&amp;quot;entityCreated&amp;quot;, entityCreatedHandler);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{CSharpContainer|&lt;br /&gt;
{{Parameters}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;entity&amp;#039;&amp;#039;&amp;#039;: {{RageType|Entity}} - the [[:Category:Entity API|entity]] that was created&lt;br /&gt;
&lt;br /&gt;
{{Example}}&lt;br /&gt;
The example below logs in server console when an entity is created, showing the entity model, position and remoteId.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
[ServerEvent(Event.EntityCreated)]&lt;br /&gt;
public void OnEntityCreated(GTANetworkAPI.Entity entity)&lt;br /&gt;
{&lt;br /&gt;
    NAPI.Util.ConsoleOutput($&amp;quot;{entity.Model} created at {entity.Position} with serverside id:{entity.Id}&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ClientsideCsEvent}}&lt;br /&gt;
&lt;br /&gt;
{{CSharpContainer|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public delegate void OnEntityCreatedDelegate(Entity entity);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{Parameters}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;entity&amp;#039;&amp;#039;&amp;#039; - the streamed in entity, expects &amp;#039;&amp;#039;&amp;#039;RAGE.Elements.Entity&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
{{Example}}&lt;br /&gt;
The example below sends a message to client when an entity is created, showing the entity model, position and remoteId.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
Events.OnEntityCreated += OnEntityCreated;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public void OnEntityCreated(RAGE.Elements.Entity entity)&lt;br /&gt;
{&lt;br /&gt;
   RAGE.Chat.Output($&amp;quot;{entity.Model} created at {entity.Position} with serverside id:{entity.RemoteId}&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[entityDeleted]]&lt;br /&gt;
* [[entityDestroyed]]&lt;br /&gt;
* [[entityModelChange]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Entity API]]&lt;br /&gt;
[[Category:Server-side Event]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Pietrodc0</name></author>
	</entry>
</feed>