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

Export current inventory


komjj
 Share

Recommended Posts

In the source (server) you can call these subs:
Call WriteINI
Call ReadINI

Of course, your other program has to be able to read .ini format.
Although, you will have to go to Sub TakeItem and Sub GiveItem because you will have to add that, when a player gets or loses an item, the .ini will have to update.
Link to comment
Share on other sites

INI is a poor way to do it. Just have it save it in plain text.

Something like this:

```
Public Sub ExportInventory()
Dim FileName As String
Dim F As Integer
Dim n as long

        FileName = App.Path & "\inventory.txt"

        F = FreeFile
        Open FileName For Append As #F
            For n = 1 To MAX_INV
                Print #F, "Inventory Slot " & n & " Item: " & Item(GetPlayerInvItemNum(Index, n)).Name & " x" & GetPlayerInvItemValue(Index, n)
            Next
        Close #F
    End If
End Sub
```
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...