net.WriteByte

From GMod Wiki

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


Examples

DescriptionSends the byte 255 to the client.
Used onNewerShared.png
Code
if CLIENT then
    net.Receive("Test", function(len)
        print("Test", len)
        print(net.ReadByte())
        end)
 
else
 
 
    net.Start("Test")
        net.WriteByte(255)
    net.Send(Entity(1))
end
 
OutputEntity 1 will recieve the byte 255 this can be read using net.Recieve


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox