Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

(eo) Call Sub


Murdoc
 Share

Recommended Posts

I'm fairly new to vb, and wondering how I can call this Sub from the client to the server under CanAttackNpc:

Public Sub QuestWindow(ByVal EditorIndex As Byte)
    frmMainGame.picQuestBack.Visible = True
    frmMainGame.lblQuestMsg.Caption = Trim$(Npc(EditorIndex).QuestMsg1)
    frmMainGame.lblQuestMsg.Visible = True
End Sub

I'm not sure If I have the definitions right. But basically I want to call a picturebox (from a Server side code) with text on it. The text is determined by QuestMsg1\. Any help is appreciated. :)
Link to comment
Share on other sites

I am new too but I will try  ;D

CLIENT  :huh:
search ' Packets sent by server to client
add```
SQuestPic
```
modHandleData

HandleDataSub(SQuestPic) = GetAddress(AddressOf HandleQuestPic)

and add this sub

```
Private Sub HandleQuestPic(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

Dim Buffer As clsBuffer
Dim msg As String
Set Buffer = New clsBuffer
Buffer.WriteBytes Data()

msg = buffer.readstring
Set Buffer = Nothing

frmMainGame.picQuestBack.Visible = True
    frmMainGame.lblQuestMsg.Caption = "" & msg & ""
    frmMainGame.lblQuestMsg.Visible = True

end sub
```
Finish

Now server

make some sub as you like
I will make this as exemple

```
Sub QuestMsg(byval index as long,byval msg as string)
Dim Buffer As clsBuffer
Set Buffer = New clsBuffer
Buffer.WriteLong SQuestPic
Buffer.WriteString Msg
SendDataTo index, Buffer.ToArray()

    Set Buffer = Nothing
end sub
```

search ' Packets sent by server to client

add this SQuestPic

there we go

good luck  :renzo:
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...