DeleteNetPlayer.htm 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>DeleteNetPlayer playerID</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. playerID = value assigned when player was created with CreateNetPlayer
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. Using the playerID generated by the CreateNetPlayer command, this command will remove the designated player from the network game. <br />
  21. <br />
  22. This also causes a special message to be sent to all remote machines (see NetMsgType).
  23. </td>
  24. </tr>
  25. </table>
  26. <h1><a href=../2d_examples/DeleteNetPlayer.bb>Example</a></h1>
  27. <table>
  28. <tr>
  29. <td>
  30. ; DeleteNetPlayer example <br />
  31. <br />
  32. newGame = StartNetGame() <br />
  33. ; Check the status of the new game. If newGame = 0 Then <br />
  34. Print "Could not start or join net game." <br />
  35. End <br />
  36. <br />
  37. ElseIf newGame = 1 <br />
  38. Print "Successfully joined the network game" <br />
  39. ElseIf newGame = 2 <br />
  40. Print "A new network game was started!" <br />
  41. EndIf <br />
  42. <br />
  43. ; Create a random player name <br />
  44. name$="Player" + Rand(100) <br />
  45. <br />
  46. ; Get a unique player id number for the player <br />
  47. ; and create the player <br />
  48. playerID=CreateNetPlayer(name$) <br />
  49. <br />
  50. If playerID = 0 Then <br />
  51. Print "Player could not be created!" <br />
  52. Else <br />
  53. Print "Player " + name$ + " was created and given ID#" + playerID <br />
  54. WaitKey() <br />
  55. ; delete the player! <br />
  56. DeleteNetPlayer playerID <br />
  57. Print "The local player was deleted!" <br />
  58. End If <br />
  59. waitkey() <br />
  60. </td>
  61. </tr>
  62. </table>
  63. <br>
  64. <a target=_top href=../index.htm>Index</a><br>
  65. <br>
  66. 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>
  67. </html>