69 lines
1.8 KiB
HTML
69 lines
1.8 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>DeleteNetPlayer playerID</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
playerID = value assigned when player was created with CreateNetPlayer
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
Using the playerID generated by the CreateNetPlayer command, this command will remove the designated player from the network game.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
This also causes a special message to be sent to all remote machines (see NetMsgType).
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../2d_examples/DeleteNetPlayer.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; DeleteNetPlayer example
|
|
<br />
|
|
|
|
<br />
|
|
newGame = StartNetGame()
|
|
<br />
|
|
; Check the status of the new game. If newGame = 0 Then
|
|
<br />
|
|
Print "Could not start or join net game."
|
|
<br />
|
|
End
|
|
<br />
|
|
|
|
<br />
|
|
ElseIf newGame = 1
|
|
<br />
|
|
Print "Successfully joined the network game"
|
|
<br />
|
|
ElseIf newGame = 2
|
|
<br />
|
|
Print "A new network game was started!"
|
|
<br />
|
|
EndIf
|
|
<br />
|
|
|
|
<br />
|
|
; Create a random player name
|
|
<br />
|
|
name$="Player" + Rand(100)
|
|
<br />
|
|
|
|
<br />
|
|
; Get a unique player id number for the player
|
|
<br />
|
|
; and create the player
|
|
<br />
|
|
playerID=CreateNetPlayer(name$)
|
|
<br />
|
|
|
|
<br />
|
|
If playerID = 0 Then
|
|
<br />
|
|
Print "Player could not be created!"
|
|
<br />
|
|
Else
|
|
<br />
|
|
Print "Player " + name$ + " was created and given ID#" + playerID
|
|
<br />
|
|
WaitKey()
|
|
<br />
|
|
; delete the player!
|
|
<br />
|
|
DeleteNetPlayer playerID
|
|
<br />
|
|
Print "The local player was deleted!"
|
|
<br />
|
|
End If
|
|
<br />
|
|
waitkey()
|
|
<br />
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<a target=_top href=../index.htm>Index</a><br>
|
|
<br>
|
|
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=DeleteNetPlayer&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|