Thanks for your tip.
Unfortunately, the pointer doesn't send to server.
Yesterday I tried another way, it worked but still have some problems.

I tested the code by a host and two clients.
In the first time, three players enter the game in sequence,
and all players can click each other and get correct health.
But when a client leaves the game and enter again, he can't click anyone anymore.
In other words, his click can't trigger the enable_click event.

I thinks it's because the new client can't get others' pointer,
so I have to resend all the entity pointers.
The problem is : How to resend pointer so that the new client can receive?
Can someone help me? Thanks very much.

My new code is as following :
Code:

entity* ent_you;

panel pan_show
{
pos_x = 500;
pos_y = 0;
digits = 20, 10, 5, _a4font,1,ent_you.health;
layer = 20;
flags = refresh, d3d;
}


action move_player1 //three player actions, I just paste one
{
actor = 1;
wait(1);
proc_client(my,move_player_local);

if(connection == 3)
{
move_player_local();
}
}


function move_player_local()
{
player_move();
}

function player_events()
{
if(event_type == event_click)
{
ent_you = me;
pan_show.visible = on;
}

// client disconnected
if (EVENT_TYPE == EVENT_DISCONNECT)
{
ent_remove(me); // remove ent of player that quit
}
}

function fun_LocalEvent()
{
ent_you = me;
pan_show.visible = on;
}

function fun_ClickLocal()
{
if(connection == 2)
{
my.enable_click = on;
my.event = fun_LocalEvent;
}
}

function player_move()
{
my.enable_disconnect = ON;
my.enable_click = ON;
my.event = player_events;

my.nosend_frame = on; // don't send animation

sleep(.3); // this can be left at .3 no matter what
ent_sendnow(my);
sleep(.3); // sleep(3); // high latency solution for now

proc_local(my,fun_ClickLocal);

if(actor == 1)
{
my.health = 50;
}
if(actor == 2)
{
my.health = 40;
}
if(actor == 3)
{
my.health = 30;
}
send_skill(my.health,send_all);


while(1)
{
......//movement code
}
}




Last edited by anfuncy; 07/27/06 06:15.