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

[Bug Fix] Fixing Serious Errors in Trade


Valentine90
 Share

Recommended Posts

**Sorry my english**

Some things go unnoticed when tested on localhost, but when you can find online is very serious errors, you can click a button to trade 2 times or more by example and cause errors on the server, or to also accept an exchange, the following exchange is accepted automatically, without you confirm, this tutorial will fix these bugs and various other erros in trade.

**Open Server**

**1 -** In **modHandleData**, look for:

```
tradeTarget = TempPlayer(index).TradeRequest
```

**2 -** Upon add:

```
If TempPlayer(index).InTrade > 0 Then

TempPlayer(index).TradeRequest = 0

Else
```

**3 -** Before End Sub and at the same time, after of:

```
SendTradeUpdate tradeTarget, 1
```

**4 -** Add:

```
End If
```

**5 -** Now look for:

```
Sub HandleAcceptTrade(
```

**6 -** After of:

```
Dim itemnum As Long
```

**7 -** Add:

```
If GetPlayerMap(index) <> GetPlayerMap(TempPlayer(index).InTrade) Then Exit Sub
```

**8 -** Beneath of:

```
tradeTarget = TempPlayer(index).InTrade
```

**9 -** Add:

```
If tradeTarget > 0 Then
```

**10 -** After of:

```
TempPlayer(index).InTrade = 0

TempPlayer(tradeTarget).InTrade = 0
```

**11 -** Add:

```
TempPlayer(index).AcceptTrade = False

TempPlayer(tradeTarget).AcceptTrade = False
```

**12 -** Before End Sub and at the same time, after of:

```
SendCloseTrade tradeTarget
```

**13 -** Add:

```
End If
```

**14 -** Now look for:

```
Sub HandleDeclineTrade(
```

**15 -** Beneath of:

```
tradeTarget = TempPlayer(index).InTrade
```

**16 -** Add:

```
If tradeTarget > 0 Then
```

**17 -** After of:

```
TempPlayer(index).InTrade = 0

TempPlayer(tradeTarget).InTrade = 0
```

**18 -** Add:

```
TempPlayer(index).AcceptTrade = False

TempPlayer(tradeTarget).AcceptTrade = False
```

**19 -** Before End Sub and at the same time, after of:

```
SendCloseTrade tradeTarget
```

**20 -** Add:

```
End If
```

**Credits:**

Valentine
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...