void main()
{
if (!connection) { // not started with -cl / -sv -cl?
if (!session_connect(app_name,"")) // no client found on the localhost?
session_open(app_name); // start as server
}
do{wait(1);}
while(dplay_status < 2); // wait until the session is opened or joined
dplay_localfunction = 2; //run actions on both server and client
level_load("valiance.wmb"); // load the level
if(connection & CONNECT_SERVER) //are we a server?
{
ent_create("testing.mdl",vector(100,0,0),fItem); //OMG a monster was killed!!! Drop an item ont he server!
}
else
{
ent_create("testing.mdl",vector(0,0,0),NULL);
}
}