Basically I created a function that scans all entities, returns a pointer to that entity, and starts functions specifically for that entity, such as animation functions.

I use ent_next() for this.

So if ent_next() finds the player John, ent_next() will set the "you" pointer to his character model.

Now that I have a pointer to his character model, I can assign a function to it under using the "you" pointer as a means of manipulating it.

For the purpose of this post, the function is "function player_animations(you)"

Function player_animations(you)
{
my = you // this makes it easier
while(my)
{
ent_bonereset(my,"bone7");
ent_bonerotate(my,"bone7,vector(0,my.bone_tilt,0));
wait(1);
}
return;
}

This function alone if attached to pretty much ANY dynamic model will allow for bones manipulation.


The next piece of code scans entities and if it finds one, attaches a function to it.


function scan_players()
{
you = ent_next(NULL); // select first entity
while(you) // while there even is a "you"
{

PLAYER_ANIMATIONS(YOU);
// assign this function
// to whatever "you" is

you = ent_next(you); // select the next entity

wait(1);

}

return;

// if ent_next ran out of entities
// then the while loop stops and
// now it's time to close this function
}

...
if(all_players_connected) {scan_players();}
...

// if all players are connection,
start assigning pointers and functions
to them

NOTE:

You would start this function after ALL players have joined the session and have player models.

Do remember that this is just the basic concept, this is'nt the entire code. I also have ways to only assign animation functions to selected entities if they're actually players (as opposed to camera entities, particle effects, trees, ect.)

I use this same concept to arbitrarely smoothen walking/running movements over the network by assigning a function that moves the model with C_move on the client-side while periodically receiving true position updates from the models' owner every few seconds, kinda like artificial position interpolation, this is sooo much smoother.