Results 1 to 1 of 1

Thread: Help with function

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    124

    Help with function

    Hi,

    i wanted to add a storage function to the code i attached, when i say storage its for a game.

    i did attempt it and i`ll post the code here, but i want it done the way it was intended.

    my way..just lists items in the database which share my guid and isnt ONPLAYER, because of this...no structure means i had no way to check
    how many slots was available or max to store your items..i would have
    to of made an array to keep count of all the items which aint onplayer in the db.

    this just lists the stored items but i guessed if i cud do that i cud do anything.

    btw thiers a popupmnu on the client which send`s the listindex of the item to the server.

    VB Code:
    1. Public Sub display(Index As Integer)
    2. On Error Resume Next
    3. Dim a As Integer
    4. Dim msg As String
    5.  
    6. msg = Chr$(2)
    7. '
    8. If City(User(Index).Location).OwnerGUID <> User(Index).UName Then
    9.    frmMain.wsk(Index).SendData Chr$(2) & "You need to return to you hideout before you can stash items." & vbCrLf & vbCrLf & Chr$(0)
    10.    DoEvents
    11.    Exit Sub
    12. End If
    13.  
    14. For a = 0 To UBound(Item)
    15.       If Item(a).ItemGUID = User(Index).UserGUID And _
    16.          Item(a).OnPlayer = False Then 'item belongs to me, aint on me..so must be stored.
    17.          frmMain.wsk(Index).SendData Chr$(2) & "Your stash, type grab itemname." & vbCrLf & vbCrLf & Chr$(0)
    18.          DoEvents
    19.          msg = msg & Item(a).IName & vbCrLf & Chr$(0)
    20.    End If
    21. Next a
    22.  
    23. 'Runs if no item in room matches get message
    24. frmMain.wsk(Index).SendData Chr$(2) & "You have no stashed items matching that name." & vbCrLf & vbCrLf & Chr$(0)
    25. DoEvents
    26.  
    27.  
    28. frmMain.wsk(Index).SendData msg & Chr$(0)
    29. DoEvents
    30. End Sub

    in the code however ull notice Storage(49) As Integer and its
    used in a few other places...so i need help doing it that way please.
    Attached Files Attached Files
    Last edited by totaly; Jan 3rd, 2007 at 07:05 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width