03-09-2009, 04:44 PM
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