send_string (STRING*)

send_string_to (ENTITY*, STRING*)

send_string_id (var client_id, STRING*)

Updates the content of a STRING object from a client to the server, or from a server to all clients (send_string), to a client that has created a certain entity (send_string_to), or  LC  to a client with a certain id number (send_string_id). The on_server or on_client event function is triggered on each PC which has received the string, and the old string content is replaced by the new received string. This function can be used for exchanging messages.


ENTITY* - Entity pointer, or NULL for sending to all clients.
client_id - client number as received by the join event or stored in the struct of a client-created entity ( see atypes.h).
STRING* - String to send.





result = inkey(message_str); // the user types a message on the server 
if (result == 13) { // if [ENTER] pressed
   send_string_to(NULL,message_str);	// send that string to all players
} // message_str on all clients now contains the entered message 		 

See also:

send_var, send_data_to, session_connect, on_server, on_client ► latest version online