Well...I've never really done a tutorial before. So I figured I'd do something simple that I'm using, so, who knows someone else might find it useful too.
Client Side:
In modGameLogic under:
Code:
If LCase(Mid(MyText, 1, 5)) = "/help" Then
Call AddText("Social Commands:", HelpColor)
Call AddText("'msghere = Broadcast Message", HelpColor)
Call AddText("-msghere = Emote Message", HelpColor)
Call AddText("!namehere msghere = Player Message", HelpColor)
Call AddText("/trade namehere = Player Trade, /accept to accept, /decline to decline", HelpColor)
Call AddText("/party namehere = Invite player to party, /join to accept, /leave to decline", HelpColor)
Call AddText("Available Commands: /help, /info, /who, /fps, /inv, /stats, /refresh, /declinechat, /chat, /8ball, /rainbow, /away, /calladmins, /wish, /minimap", HelpColor)
MyText = ""
Exit Sub
End If
Add this:
Code:
' Save
If LCase(Mid(MyText, 1, 5)) = "/save" Then
Call SaveplayerData
MyText = ""
Exit Sub
End If
Then in ModClientTCP add this to the very bottom:
Code:
Sub SaveplayerData()
Dim Packet As String
Packet = "SAVEPLAYERDATA" & SEP_CHAR & END_CHAR
Call SendData(Packet)
End Sub
Server Side:In ModServerTCP in the handle data sub, or ModHandledata, above this:
Code:
' :: Request edit map packet ::
Add:
Code:
' ::::::::::::::::::::::::
' :: Save Player Packet ::
' ::::::::::::::::::::::::
Case "saveplayerdata"
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
That's all of it. It basically just makes it so when a player types /save in a safe zone map it saves their data...If there's any questions or something you don't understand feel free to ask.