Ertzel Posted October 10, 2012 Author Share Posted October 10, 2012 In any version of EA above 3.0.13 that uses Deathbeam's edited event system. The TakeItem does not check if the user actually has the correct amount of the item.It allows you to set an amount, but the code just takes away all of the item even if its a stackable item that you have more of then the event wants.The following is a quick bugfix so it will only take the correct amount of the item, and warn you if you don't have enough.Server-SideFind```Public Sub TakePlayerItems(ByVal Index As Long, ByVal itemID As Long, ByVal itemCount As Long)```and replace the whole sub with:```Public Sub TakePlayerItems(ByVal Index As Long, ByVal itemID As Long, ByVal itemCount As Long)If HasItem(Index, itemID) >= itemCount ThenTakeInvItem Index, itemID, itemCountElsePlayerMsg Index, "You need [" & itemCount & "] of [" & Trim$(Item(itemID).name) & "]", AlertColorEnd IfEnd Sub```Find:```Case Evt_Branch```then replace:```If HasItem(Index, .Data(2)) Then```With:```If HasItem(Index, .Data(2)) >= .Data(5) Then```Save/Compile your server because this part is done.- Client Side -in frmEditor_Events go to the fraBranch and beside cmbBranchItem add a new text box called txtBranchItemAmount with the text of 0.Now double click the txtBranchItemAmount and replace the sub with:```Private Sub txtBranchItemAmount_Change()If EditorIndex = 0 Or ListIndex = 0 Then Exit SubEvents(EditorIndex).SubEvents(ListIndex).data(5) = Val(txtBranchItemAmount.Text)End Sub```Find:```cmbBranchItem.Enabled = False```and under it add:```txtBranchItemAmount.Enabled = False```Then under:```cmbBranchItem.Enabled = True```add:```txtBranchItemAmount.Enabled = True```Find```cmbBranchItem.ListIndex = .data(2) - 1```under it add:```txtBranchItemAmount.Text = .data(5)```Then save/compile your source and its done! Link to comment Share on other sites More sharing options...
jaekx Posted October 10, 2012 Share Posted October 10, 2012 You sir, are a hero of mine. Link to comment Share on other sites More sharing options...
Ne-o-x Posted November 7, 2012 Share Posted November 7, 2012 Nice fix. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now