send_var(void* addr)

send_var_to (ENTITY*,void* addr)

send_var_id (var client_id,void* addr)

Updates a global variable or a struct 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 variable, and the old content of the variable or struct is replaced by the new value.

Parameters:

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).
addr - address of the variable or struct to be sent.

Remarks:

Edition:

 C 

Example:

var x;
...
send_var_to(NULL,x); // send the current value of x to all clients 

See also:

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