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

[Bug Fix] Fixing Errors on Trade and Bank


Valentine90
 Share

Recommended Posts

**Sorry my english**

In trade you can exchange an amount of money 0\. At the bank you can deposit or withdraw an amount of money 0\. No error in the client or server, but it would not be a very good thing to let that happen.

**Open Server**

**1 -** In **modHandleData**, within

```
Sub HandleTradeItem
```

**2 -** Look for:

```
' make sure they have the amount they offer

If amount < 0 Or amount > GetPlayerInvItemValue(index, invSlot) Then

Exit Sub

End If
```

**3 -** Below add:

```
If Item(itemNum).Type = ITEM_TYPE_CURRENCY Then

If amount < 1 Then Exit Sub

End If
```

**4 -** In **modPlayer**, within

```
Sub GiveBankItem
```

**5 -** Look for:

```
If amount < 0 Or amount > GetPlayerInvItemValue(index, invSlot) Then

Exit Sub

End If
```

**6 -** Below add:

```
If Item(GetPlayerInvItemNum(index, invSlot)).Type = ITEM_TYPE_CURRENCY Then

If amount < 1 Then Exit Sub

End If
```

**7 -** Also in **modPlayer**, within

```
Sub TakeBankItem
```

**8 -** Look for:

```
If amount < 0 Or amount > GetPlayerBankItemValue(index, BankSlot) Then

Exit Sub

End If
```

**9 -** Below add:

```
If Item(GetPlayerBankItemNum(index, BankSlot)).Type = ITEM_TYPE_CURRENCY Then

If amount < 1 Then Exit Sub

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