# DeleteNetPlayer playerID

# Parameters

playerID = value assigned when player was created with CreateNetPlayer

# Description

Using the playerID generated by the CreateNetPlayer command, this command will remove the designated player from the network game. This also causes a special message to be sent to all remote machines (see NetMsgType).

# Example

; DeleteNetPlayer example
newGame = StartNetGame()
; Check the status of the new game. If newGame = 0 Then
Print "Could not start or join net game."
End
ElseIf newGame = 1
Print "Successfully joined the network game"
ElseIf newGame = 2
Print "A new network game was started!"
EndIf
; Create a random player name
name$="Player" + Rand(100)
; Get a unique player id number for the player
; and create the player
playerID=CreateNetPlayer(name$)
If playerID = 0 Then
Print "Player could not be created!"
Else
Print "Player " + name$ + " was created and given ID#" + playerID
WaitKey()
; delete the player!
DeleteNetPlayer playerID
Print "The local player was deleted!"
End If
waitkey()

Index
Click here to view the latest version of this page online