PANEL* testPNL = {
flags = SHOW;
digits(0,0,6.4,*,1,player.skill1);
digits(0,10,6.4,*,1,player.skill98);
digits(0,20,6.4,*,1,dplay_id);
digits(0,30,6.4,*,1,player.client_id);
}
void fPlayer()
{
while(my == NULL){wait(1);}
player = my;
while(connection == 0)
{
wait(1);
}
set(my,TRANSLUCENT);
while(my.skill1 == 0)
{
wait(-1);
if(connection == 2 && my.skill1 == 0)
{
my.skill98 = dplay_id;
send_skill(my.skill98,0);
}
}
wait(-0.5);
reset(my,TRANSLUCENT);
while(1)
{
wait(1);
if(my.skill98 != 0 && connection != 2)
{
my.skill1 = 1;
send_skill_id(my.skill98,my.skill1,0);
my.skill98 = 0;
}
}
}
void main()
{
dplay_localfunction = 2; //run actions on both server and client
level_load("valiance.wmb");
wait(-2);
#ifdef server //if we defined this game as a server
while(connection == 0) {wait(1);} // wait until we have a connection
#endif
#ifdef client //if we defined this game as a client
while(connection == 0) {wait(1);} // wait until we have a connection
#endif
if(connection == 1 || connection == 3)
{
player = ent_create("testing.mdl",vector(0,0,0),fPlayer);
player.skill1 = 100;
}
}