; CreateNetPlayer Example ; ----------------------- ; Host a game directly (2 = success) status=HostNetGame("demo game") If status=2 Then Print "Hosting 'demo game'" Print "" ; CreateNetPlayer adds a local player and returns a player id ; (0 = failed). At least one player must exist before messages ; can be sent or received, and every machine is told about it. alice=CreateNetPlayer("Alice") bob=CreateNetPlayer("Bob") If alice=0 Or bob=0 Then Print "The players could not be created" Else Print "Created '"+NetPlayerName$(alice)+"' with id "+alice Print "Created '"+NetPlayerName$(bob)+"' with id "+bob Print "" Print "Message commands use these ids to say who is talking" EndIf StopNetGame Print "" Print "Game stopped" Else Print "HostNetGame returned "+status+" - could not host a game" Print "(network play may be unavailable on this machine)" EndIf Print "" Print "Press any key to close the example" WaitKey End