Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
/save
#3
I hope this is alright...Sense I like this tutorial, and it's useful for lots of people, I want to update it for the MS4 version. I already have tested it out and everything. And yes, I know it's simple to change and make it work for MS4. Anyway...

::Client Side::

First add this in modGameLogic under the Commands section.
Code:
' Save
        If LCase(Mid(frmMirage.txtMyChat, 1, 5)) = "/save" Then
            Call SaveplayerData
            frmMirage.txtMyChat = ""
            Exit Sub
        End If

Then in ModClientTCP add this at the bottom.
Code:
Sub SaveplayerData()
Dim Packet As String

    Packet = CSaveplayerData & END_CHAR
    Call SendData(Packet)
End Sub

Then in modEnumerations add this under "Public Enum ClientPackets"
Code:
CSaveplayerData

::Server Side::

Now in modHandleData above the "Request edit map packet" add this.
Code:
' ::::::::::::::::::::::::
        ' :: Save Player Packet ::
        ' ::::::::::::::::::::::::
        Case CSaveplayerData
                If Map(GetPlayerMap(Index)).Moral = MAP_MORAL_SAFE Then
                    Call SavePlayer(Index)
                    Call PlayerMsg(Index, "Character Stats & Inventory Saved", Yellow)
                Else
                    Call PlayerMsg(Index, "You must be in a town or house to save!", Yellow)
            End If
        Exit Sub

Then in modEnumerations under "Public Enum ClientPackets" add this.
Code:
CSaveplayerData

All done.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)