net.WriteTable
From GMod Wiki
Function | |
Syntax |
net.WriteTable( Table ) Where is this used? |
Description: | |
Sends a table through the net library. | |
Returns: | Nil |
Part of Library: | net |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Net.WriteTable]Net.WriteTable [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Sends a table to the client. |
---|---|
Used on | |
Code | local tab = {Vector(100,100,100), 100, "Hi John", Entity(1)} net.Start("Test") --Unique name accessed by the recipent's net.WriteTable(tab) net.Send(Entity(1)) |
Output | Entity 1 will recieve the table in the script above this can be read using net.Recieve. This can be very heavy on the server if you send a large table. Althougt you have 64kb to work with, it is recommended you keep your scripts optimised. |
Additional Notes
- A max of 64kb's can be sent at one time
- WriteTable will send only tables, the tables can include data of any format although it is not recommended you use this just to send a single variable - use the other net functions to send your data format.
- Consult the net library for more details