Hi Rasch,
methode 2: Sending the array and then sending the event immediately after the enet_send_array() function was called would work. Packets are always deliverd in the correct order (if sent reliable).
But of course methode 1 is more preferable because it consumes less traffic.
This should work:
Code for sending (remember 6 * var is 6 * 4 Byte and thus 24, not 6!):
var g_data[6];
g_data[0] = muendung.x;
g_data[1] = muendung.y;
g_data[2] = muendung.z;
g_data[3] = hit.x;
g_data[4] = hit.y;
g_data[5] = hit.z;
enet_clsend_event(18, g_data, 24, BROADCAST)
Code for receiving:
function rcv_data(var sender, STRING* msg, var size)
{
var g_data[6];
memcpy(g_data, _chr(msg), 24);
// do something with the data...
}
I tested the code and it should work
