Posted By: alibaba
[ANet] Sending only an element of an array struct - 08/27/14 12:10
lets say i have a struct like this:
typedef struct {
var health;
var points;
...
}PLAYERSTRUCT;
And i declare and initialize it like this:
PLAYERSTRUCT Players[12];
Now i only want to send the health value of all 12 Players.
Do i need to do it in a for loop?
Or can i do something like this:
enet_sendto(Players.health,sizeof(var)*12,BROADCAST);
typedef struct {
var health;
var points;
...
}PLAYERSTRUCT;
And i declare and initialize it like this:
PLAYERSTRUCT Players[12];
Now i only want to send the health value of all 12 Players.
Do i need to do it in a for loop?
Or can i do something like this:
enet_sendto(Players.health,sizeof(var)*12,BROADCAST);