Posted By: anfuncy
click other client and show some informations - 07/23/06 15:13
Hi, all.
I want my client click other client and show some informations.
Suppose that clientA clicks clientB, and clientA's screen will
show clientB's health.
I tried some ways but it doesn't work.
Can someone help me?
Thanks very much!!
Code:
I want my client click other client and show some informations.
Suppose that clientA clicks clientB, and clientA's screen will
show clientB's health.
I tried some ways but it doesn't work.
Can someone help me?
Thanks very much!!
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 fun_show_health(ent)
{
ent_you = ent;
pan_show.visible = on;
}
function player_events()
{
if(event_type == event_click)
{
proc_client(you,fun_show_health(me));
}
// client disconnected
if (EVENT_TYPE == EVENT_DISCONNECT)
{
ent_remove(me); // remove ent of player that quit
}
}
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
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
}
}