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

Auction House System


JohnPony
 Share

Recommended Posts

There are a few key elements left out this, such as error checking, as of now there doesn't seem to be any extreme bugs that i haven't patched, even if you download the source you still need to head over to the second post which contains a few key elements to prevent further errors.

On the topic of the log, that is meant to log any auctions that could not find the player who was the previous bid participant. Meaning his account was most likely deleted, i never got a chance to test it out myself so i'm not sure if that even works.

I also added in the bug fix from the second post for the BidOnItem, and i will update the addon module files for people who follow the tutorial later on today.

The new compiled project will be up in about 15 minutes, and the new modules later today.
Link to comment
Share on other sites

  • Replies 78
  • Created
  • Last Reply

Top Posters In This Topic

> If you changed the currency number, make sure you changed it for everything or it will cause some errors.
>
> Later today when i get home I'll make it a bit simpler with a constant.

Yes, I changed the whole engine to work with item 2 as currency. but forgot for the auction system XD
Link to comment
Share on other sites

Great tutorial thanks for putting this online, was searching for something like that, but i got a Bug.

~~If someone sells an Item, the selled item dont get removed from his Inventory, neither he gets the Money they buyer pays for the Item.~~ [Fixed]

If someone Buys an item, the Currency he Pays, is given back to him after he Wons the Auction + the Seller dont get any currency at all.

p.s.

A nice feature would be if the Auctionmenu was only acessable via a NPC, a Sign or something like that.
Link to comment
Share on other sites

Shouldn't the Call AddLog thing have the PLAYER_LOG instead of " " ?

Call AddLog("Auction Failed To Find A Player And Return " & Bid & " To Them!", PLAYER_LOG)

[EDIT]

Can you actually give 0 amount of item to the player ? O.o

Call GiveInvItem(Index, Auction(AuctionNum).Item, 0, True)
Link to comment
Share on other sites

ummm… I didn't use this tutorial in any engine. The one in the download is one using 3.0 since it has the old GUI but the only thing that would change is the button on the game screen to open the auction form client side.

But what your error is in, is part of modAuction client side. So either you edited it and ducked it up or didn't add modAuction to your server correctly.
Link to comment
Share on other sites

Guys calm down, General will sort out the problems! He's just not the best at putting everything online, trust me, when you write a big system it's hard not to forget things. And to be honest, if you can't figure out these problems yourself, you shouldn't be making a game with it! Simple as that.
Link to comment
Share on other sites

> Guys calm down, General will sort out the problems! He's just not the best at putting everything online, trust me, when you write a big system it's hard not to forget things. And to be honest, if you can't figure out these problems yourself, you shouldn't be making a game with it! Simple as that.

You're the one who need to calm down XD, I'm like Zen over here ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) and I'm just telling these errors so that General knows what errors are occouring (even if he does know they occour)
Link to comment
Share on other sites

> It gives me subscript out of range when I buy something that already has a bid on it (probably calls Sub GivePrevBid ), and it highlights the Sub ClearPlayer…

Again, you've added something wrong or missed something because it works in the compiled version.

Either wait until Gen fixes up the tutorial to include everything or rip it properly out from the compiled version yourself.
Link to comment
Share on other sites

> Again, you've added something wrong or missed something because it works in the compiled version.
>
> Either wait until Gen fixes up the tutorial to include everything or rip it properly out from the compiled version yourself.

As I said, I'm using CS:DE, I did everything as asked and I even had to edit the DrawGDI thingy

[EDIT] I also added a GDI thing when you are buying, so people can see what the duck they are buying XD
Link to comment
Share on other sites

Anyone who has already begun the tutorial, add the following things to modAuctions server side.

```

Private Sub AuctionSoldOut(ByVal AuctionNum As Long, ByVal Name As String)

Dim i As Long

Dim Filename As String

Dim F As Long

Dim PlayerName As String

i = Player_HighIndex + 3

Call ClearPlayer(i)

Filename = App.path & "\data\accounts\" & Trim(Name) & ".bin"

F = FreeFile

Open Filename For Binary As #F

Get #F, , Player(i)

Close #F

Player(i).Money = Auction(AuctionNum).Bid

Filename = App.path & "\data\accounts\" & Trim(Name) & ".bin"

F = FreeFile

Open Filename For Binary As #F

Put #F, , Player(i)

Close #F

Call ClearPlayer(i)

End Sub

```

And in BidOnAuction replace the previous bid procedure with this:

```

' Lets check if we won!

If Bid >= Auction(AuctionNum).MaxBid Then

Call PlayerMsg(Index, "You Have Won " & Trim$(Item(Auction(AuctionNum).Item).Name) & " !", Red)

Call GiveInvItem(Index, Auction(AuctionNum).Item, 0, True)

If SellerIndex <> 0 Then

Call GiveInvItem(SellerIndex, 1, Auction(AuctionNum).Bid, True)

Call PlayerMsg(SellerIndex, "Your auction has sold!", Red)

Else

Call AuctionSoldOut(AuctionNum, Auction(AuctionNum).Owner)

End If

Call DestroyAuction(AuctionNum)

Call SendAuctions

Else

' We are not quite there yet ;D

Call PlayerMsg(Index, "You Are " & Auction(AuctionNum).MaxBid - Bid & " Away from winning this auction!", Red)

End If

```

Find

```
If Player(Index).Money > 0 Then
```

in Sub JoinGame and replace it with:

```

If Player(Index).Money > 0 Then

Call PlayerMsg(Index, "You Reieve Money From The Auction House!", Red)

Call GiveInvItem(Index, 1, Player(Index).Money, True)

Player(Index).Money = 0

End If

```

If you find any further bugs, please notify me and i will fix them ASAP.

I will be updating the compiled source and Addons momentarily.

Edit:

The compiled version and the addon's now have this fixed, Thanks for notifying me of the bug guys.
Link to comment
Share on other sites

Subscript out of range when I 'outbid' myself (maybe another person will do the same error) and it takes me to this line:

Call ZeroMemory(ByVal VarPtr(TempPlayer(Index)), LenB(TempPlayer(Index)))

in

```

Sub ClearPlayer(ByVal Index As Long)

Dim i As Long

Call ZeroMemory(ByVal VarPtr(TempPlayer(Index)), LenB(TempPlayer(Index)))

Set TempPlayer(Index).Buffer = New clsBuffer

Call ZeroMemory(ByVal VarPtr(Player(Index)), LenB(Player(Index)))

Player(Index).Login = vbNullString

Player(Index).Password = vbNullString

Player(Index).Name = vbNullString

Player(Index).Class = 1

frmServer.lvwInfo.ListItems(Index).SubItems(1) = vbNullString

frmServer.lvwInfo.ListItems(Index).SubItems(2) = vbNullString

frmServer.lvwInfo.ListItems(Index).SubItems(3) = vbNullString

End Sub

```

[EDIT] Used another account to outbid myself, still throws the error
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...