dplay_status

The current status of a multiplayer game.

Type:

var, read-only.

Range:

0 - single player mode (connection is 0)
1 - connected to a session (connection is 1)
2 - joined a session (dplay_id becomes valid)
4 - loaded a level after joining a session
6 - level was updated by the server
8 - opened a session in server mode (connection is 2 or 3)

Example (lite-C):

session_connect("office","127.0.0.1");
while(dplay_status < 2) wait(1); // wait until the session is opened or joined
load_level("office.wmb");
while(dplay_status < 6) wait(1); // wait until the level is up to date
me = ent_create("player.mdl",player_pos,player_action);
while(my.client_id != dplay_id) wait(1); // wait until the server confirmed the entity creation

See also:

session_connect, connection, dplay_id, client_id

► latest version online