Server side
Go to modServerTCP
Find
Sub SendWhosOnline
add this code underneath:
Sub SendOnlineList(ByVal index As Long)
Dim packet As String
Dim i As Long
Dim n As Long
packet = ""
n = 0
For i = 1 To MAX_PLAYERS
If IsPlaying(i) Then
packet = packet & SEP_CHAR & GetPlayerName(i) & SEP_CHAR
n = n + 1
End If
Next i
packet = "ONLINELIST" & SEP_CHAR & n & packet & END_CHAR
Call SendDataToAll(packet)
End Sub
Find
Sub HandleData
Find
Whos Online Packet
add this code underneath:
' :::::::::::::::::::::::
' :: Online list ::
' :::::::::::::::::::::::
If LCase(Parse(0)) = "onlinelist" Then
'Stop
Call SendOnlineList(index)
Exit Sub
End If
Find
Sub JoinGame
after this code:
Call SendTimeTo(index)
add this code underneath:
Call SendOnlineList(index)
Find
Sub LeftGame
After this code:
Call ClearPlayer(index)
Add this code underneath:
Call SendOnlineList(index)
Finished Server side.
Open Client.
Go to modClientTCP
Find
Sub SendWhosOnline
Add this code underneath it:
Sub SendOnlineList()
Dim packet As String
packet = "ONLINELIST" & SEP_CHAR & END_CHAR
Call SendData(packet)
End Sub
Go to
Sub HandleData
Scroll to the bottom of the handle data sub and add this at the end:
' ::::::::::::::::::::::::::
' :: Get Online List ::
' ::::::::::::::::::::::::::
If LCase(Parse(0)) = "onlinelist" Then
frmMirage.lstOnline.Clear
n = 2
z = Val(Parse(1))
For x = n To (z + 1)
frmMirage.lstOnline.AddItem Trim(Parse(n))
n = n + 2
Next x
Exit Sub
End If
Now open up frm mirage, add a listbox and name it lstOnline, and set it's visibilty to false. add a picbox named picOnline with visiblity set to true and another named picOffline with visibilty set to false. finally add a label named label9 and set it's cation to "Who Is Online." now view the source and add this code:
Private Sub picOffline_Click()
Call SendOnlineList
lstOnline.Visible = False
picOffline.Visible = False
picOnline.Visible = True
Label9.Visible = False
End Sub
Private Sub picOnline_Click()
Call SendOnlineList
lstOnline.Visible = True
picOffline.Visible = True
picOnline.Visible = False
Label9.Visible = True
End Sub