Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Feature] Party System
#12
Code:
Public Declare Sub ZeroMemory Lib "Kernel32.dll" Alias "RtlZeroMemory" (Destination As Any, ByVal Length As Long)

Code:
Sub SendPartyMsg(ByVal PartyIndex As Long, ByVal Msg As String, ByVal Color As Byte)
Dim Buffer As clsBuffer

    Set Buffer = New clsBuffer
    
    Buffer.PreAllocate Len(Msg) + 9
    Buffer.WriteLong CMsgChatMsg
    Buffer.WriteString Msg
    Buffer.WriteByte Color

    SendDataToParty PartyIndex, Buffer.ToArray()
End Sub

Code:
Sub SendDataToParty(PartyIndex As Long, ByRef Data() As Byte)
Dim i As Long
Dim n As Long
    For i = 1 To MAX_PLAYER_PARTY
        If LenB(Party(PartyIndex).PartyPlayers(i)) > 0 Then
            n = FindPlayer(Party(PartyIndex).PartyPlayers(i))
            If n > 0 Then
                SendDataTo n, Data
            End If
        End If
    Next
End Sub
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)