Squirrel/Server/Functions/Sockets/SendClient
From Liberty Unleashed Wiki
(Difference between revisions)
(→Example) |
|||
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|Socket.SendClient}} | |
This function sends the given data using a socket. | This function sends the given data using a socket. | ||
Latest revision as of 10:11, 11 October 2010
This function sends the given data using a socket.
[edit] Syntax
bool Socket.SendClient( string data, int connection )
[edit] Arguments
- data - This is the data you want to send via the socket as a string
- connection - The ID of the client you wish to send data for
[edit] Example
function onPlayerChat( player, text ) { p_Socket.Send( text, 0 ); }
This would send the text that the player said to connection id 0. p_Socket was created in the Connect function.
[edit] Notes
The call onPlayerChat was used in in this example. More info about this in the corresponding page.