This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
send
NicholasScott1337 edited this page Jul 18, 2015
·
2 revisions
- Call-Only
- The entirety of the library, running this will send a table to the server OR client with a command to run and parameters
- Table
- Table you want to send across the network, this can contain anything EXCEPT other tables!!!!
- CMD
- The command you want to run on the other end, string, IE. "print", "update", "sync" etc.
- Param
- Parameters you want to go with the command, this can be useful for things like "killPlayer" you can supply the players id/name in the parameters, rather than in the table as an extra variable
- ID
- This is a server side parameters, this is the id of the client you want to send to, Nil out on client side issuing
Nil
Nil
Registers a command server side for clients to run, then runs it from a client
--Server
Net:registerCMD( "KillMe", function( table, param, id, dt )
killUser( id )
end )
--Client
local table = {}
Net:send( table, "KillMe", Nil ) -- This will kill them
Registers a command client side for the server to run, then runs it from a server
--Client ID:"31.224.116.12:10057"
Net:registerCMD( "print", function( table, param, dt )
print( "Server: "..param )
end )
--Server
local table = {}
Net:send( table, "print", "Hello", "31.224.116.12:10057" ) -- This prints to their console "Hello"