net.WriteTable

From GMod Wiki

Jump to: navigation, search
Function
Syntax net.WriteTable( Table )
Where is this used?
Description:
Sends a table through the net library.
Returns: Nil
Part of Library: net
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Net.WriteTable]Net.WriteTable [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionSends a table to the client.
Used onNewerShared.png
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))
 
OutputEntity 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

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox