Squirrel/Server/Functions/Sockets/Send

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|Socket.Send}}
 
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

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function sends the given data using a socket.

[edit] Syntax

  1. bool Socket.Send( string szData )

[edit] Arguments

  • szData - This is the data you want to send via the socket as a string

[edit] Example

  1.  
  2. function onPlayerChat( player, text )
  3. {
  4. p_Socket.Send( "PRIVMSG #CHANNELNAME " + text + "\n" );
  5. }
  6.  

This would send the text that the player said to #CHANNELNAME if it was connected to an IRC server. 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.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox