here is the code I used. note that I'm not using an array, as there are 4 players max. and I'm not actually using send_xx_to, all clients get the same data in my system. too complicated otherwise..

Code:

define plid, skill1;

// on client:

	local_pl = ent_create ("dummy.mdl", vector (0,0,-5000), plent_act);
	sleep (2); // sleep time can be shorter, but in my game updates are only send every 2 seconds.
	while (local_pl.plid == 0) {wait (1);}
	local_faction = local_pl.plid;

[...]

// on server
function plent_event()
{
	if (EVENT_TYPE == EVENT_DISCONNECT)
	{
		ent_remove (me);
	}
}

function plent_act()
{
	my.enable_disconnect = 1;
	my.event = plent_event;

	if (pl1 == null) {my.plid = 1; pl1 = me; goto plent_slotsdone;}
	if (pl2 == null) {my.plid = 2; pl2 = me; goto plent_slotsdone;}
	if (pl3 == null) {my.plid = 3; pl3 = me; goto plent_slotsdone;}
	if (pl4 == null) {my.plid = 4; pl4 = me; goto plent_slotsdone;}
	diag ("\n all slots full?!");

	plent_slotsdone:

	sleep (2);
	send_skill (my.plid, null);
}