net.WriteEntity
From GMod Wiki
Function | |
Syntax |
net.WriteEntity( Entity ) Where is this used? |
Description: | |
Sends a entity object through the net library. | |
Returns: | Nil |
Part of Library: | net |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Net.WriteEntity]Net.WriteEntity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Sends the player entity object to the client. |
---|---|
Used on | |
Code | net.Start("Test") --Unique name accessed by the recipent's net.WriteEntity(Entity(1)) net.Send(Entity(1)) |
Output | Entity 1 will recieve their own player entity object this can be read using net.Recieve. This is not a very useful example although it is simply an example and the map contains no other entities at this time. |
Additional Notes
- A max of 64kb's can be sent at one time
- WriteEntity will send any entity objects, including players - use the other net functions to send your data format if it is not an entity.
- It is not recommended that you send your own entity object to yourself as LocalPlayer suffices.
- Consult the net library for more details