Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Gold System
#1
Okay, I was trying to create a new item and PlayerRec so I could record how much gold they have instead of using an item that appears in the Inventory.
I've come to a halt because I've received this silly error:

"You have lost your connection with Mirage Source 4"

I'm guessing that something isn't synced properly, but for the life of me I've confused myself so I am looking to the genius of this forum to suss it out. Tongue Hopefully.

So far this is what I have added:
[spoiler]SERVER

ADDED: modConstants - at the end of Item Constants
Code:
Public Const ITEM_TYPE_GOLD As Byte = 14
ADDED: modTypes - under PK as Byte
Code:
Gold As Long
ADDED: modPlayer
Code:
Public Function GetPlayerGold(ByVal Index As Long)
    GetPlayerGold = Player(Index).Char(TempPlayer(Index).CharNum).Gold
End Function

Public Sub SetPlayerGold(ByVal Index As Long, ByVal Value As Long)
    Player(Index).Char(TempPlayer(Index).CharNum).Gold = Value
End Sub
ADDED: modEnumerations - under SCastSpell
Code:
SGold
ADDED: modEnumerations - under CStats
Code:
CGold
ADDED: modHandleData - under CQuit
Code:
Case CGold
            HandlePlayerGold Parse
ADDED: modHandleData
Code:
' :::::::::::::::::::::::::
' :: Player Gold packet ::
' :::::::::::::::::::::::::
Private Sub HandlePlayerGold(ByVal Index as Long, ByRef Parse() As String)
    Call SetPlayerGold(Index, GetPlayerGold(Index), CLng(Parse(1)))
End Sub



CLIENT

ADDED: modConstants - at the end of Item Constants
Code:
Public Const ITEM_TYPE_GOLD As Byte = 14
ADDED: modTypes - PlayerRec under PK as Byte
Code:
Gold As Long
ADDED: modDatabase
Code:
Public Function GetPlayerGold(ByVal Index As Long)
    GetPlayerGold = Player(Index).Gold
End Function

Public Sub SetPlayerGold(ByVal Index As Long, ByVal Value As Long)
    Player(Index).Gold = Value
End Sub

ADDED: modHandleData
Code:
' :::::::::::::::::::::::::
' :: Player Gold packet ::
' :::::::::::::::::::::::::
Private Sub HandlePlayerGold(ByRef Parse() As String)
    Call SetPlayerGold(MyIndex, GetPlayerGold(MyIndex), CLng(Parse(1)))
End Sub
ADDED: modHandleData
Code:
Case SGold
            HandlePlayerGold Parse
[/spoiler]

I hope someone can work it it out. I really want to get on with added the rest of it in. lol
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)