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 script to the server script, or from the server script to all clients (send_var), to a client that has created a certain entity (send_var_to), or  LC  to a client with a certain id number (send_var_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.


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.





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