send_data_to (ENTITY*, void* data,var size)

send_data_id (var client_id, void* data,var size)

Sends unspecified data from a client to the server, or from a server to a certain client or to all clients. The on_server or on_client event function is triggered on each PC which has received the data. This function can be used for transferring data packets between server and clients.


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.
data - pointer to a buffer that contains the data to be sent.
size - size of the buffer in bytes.



 C   LC 


typedef struct MYDATA {
  int x;
  char c[20];
MYDATA* mydata = { x = 1; c = "Test!"; }
// sending data
//receiving data
function on_client_event(void* buffer) 
  if (event_type == EVENT_DATA)

See also:

send_var_to, send_string_to, on_server, on_client

► latest version online