net.SendToServer

From GMod Wiki

Jump to: navigation, search
Function
Syntax net.SendToServer( Nil )
Where is this used?
Description:
Sends a net function to the server from the client using the net library.
Returns: Nil
Part of Library: net
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Net.SendToServer]Net.SendToServer [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionSends data to the server from the client.
Used onNewerClient.png
Code
if SERVER then
    print("Server")
    net.Receive("Test", function(len, ply)
        print("Test: ", len, ply)
        end)
else
    net.Start("Test")
        net.WriteString("Meow")
    net.SendToServer()
end
 
OutputThe server will receive the clients data which can be read via the net.Recieve


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox