JohnPony Posted August 27, 2012 Author Share Posted August 27, 2012 Noticed this while helping someone in the Q&A board.Find```If GetPlayerInvItemNum(MyIndex, i) = 1 Then '1 = gold ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)```And try replacing it with```if Item(GetPlayerInvItemNum(MyIndex, i)).Type = ITEM_TYPE_CURRENCY Then```That is client sided of course.Also find```' If item is a stack - draw the amount you haveIf GetPlayerInvItemValue(MyIndex, i) > 1 Theny = rec_pos.Top + 22X = rec_pos.Left - 4Amount = CStr(GetPlayerInvItemValue(MyIndex, i))' Draw currency but with k, m, b etc. using a convertion functionRenderText Font_Default, ConvertCurrency(Amount), X, y, Yellow, 0' Check if it's gold, and update the labelIf Item(GetPlayerInvItemNum(MyIndex, i)).Type = ITEM_TYPE_CURRENCY Then '1 = gold ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)frmMain.lblGold.Caption = Format$(Amount, "#,###,###,###") & "g"End IfEnd If```And change it too```' If item is a stack - draw the amount you haveIf Item(GetPlayerInvItemNum(MyIndex, i)).Type <> ITEM_TYPE_ARMOR Or ITEM_TYPE_WEAPON Or ITEM_TYPE_CONSUME ThenIf GetPlayerInvItemValue(MyIndex, i) >= 1 Theny = rec_pos.Top + 22X = rec_pos.Left - 4Amount = CStr(GetPlayerInvItemValue(MyIndex, i))' Draw currency but with k, m, b etc. using a convertion functionRenderText Font_Default, ConvertCurrency(Amount), X, y, Yellow, 0' Check if it's gold, and update the labelIf Item(GetPlayerInvItemNum(MyIndex, i)).Type = ITEM_TYPE_CURRENCY Then '1 = gold ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)frmMain.lblGold.Caption = Format$(Amount, "#,###,###,###") & "g"End Ifend ifEnd If```And```If GetPlayerInvItemValue(MyIndex, i) > 1 Theny = rec_pos.Top + 22X = rec_pos.Left - 4Amount = GetPlayerInvItemValue(MyIndex, i) - amountModifier' Draw currency but with k, m, b etc. using a convertion functionIf Amount < 1000000 Thencolour = WhiteElseIf Amount > 1000000 And Amount < 10000000 Thencolour = YellowElseIf Amount > 10000000 Thencolour = BrightGreenEnd IfRenderText Font_Default, Format$(ConvertCurrency(str(Amount)), "#,###,###,###"), X, y, colour, 0' Check if it's gold, and update the labelIf Item(GetPlayerInvItemNum(MyIndex, i)).Type = ITEM_TYPE_CURRENCY Then '1 = gold ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)frmMain.lblGold.Caption = Format$(Amount, "#,###,###,###") & "g"End If```To```If Item(GetPlayerInvItemNum(MyIndex, i)).Type <> ITEM_TYPE_ARMOR Or ITEM_TYPE_WEAPON OR ITEM_TYPE_CONSUMEThenIf GetPlayerInvItemValue(MyIndex, i) >= 1 Theny = rec_pos.Top + 22X = rec_pos.Left - 4Amount = GetPlayerInvItemValue(MyIndex, i) - amountModifier' Draw currency but with k, m, b etc. using a convertion functionIf Amount < 1000000 Thencolour = WhiteElseIf Amount > 1000000 And Amount < 10000000 Thencolour = YellowElseIf Amount > 10000000 Thencolour = BrightGreenEnd IfRenderText Font_Default, Format$(ConvertCurrency(str(Amount)), "#,###,###,###"), X, y, colour, 0' Check if it's gold, and update the labelIf Item(GetPlayerInvItemNum(MyIndex, i)).Type = ITEM_TYPE_CURRENCY Then '1 = gold ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)frmMain.lblGold.Caption = Format$(Amount, "#,###,###,###") & "g"End Ifend if```Yeah i know i suck at making tutorials.Regards,General Pony Link to comment Share on other sites More sharing options...
Justn Posted August 28, 2012 Share Posted August 28, 2012 Can i skip the first step if i want only item #1 to be counted in the gold label? Link to comment Share on other sites More sharing options...
JohnPony Posted August 28, 2012 Author Share Posted August 28, 2012 > Can i skip the first step if i want only item #1 to be counted in the gold label?Yeah, just remember to remove the same code from step 2 and 3\. Like i said i messed up the tutorial but meh. ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) Link to comment Share on other sites More sharing options...
Justn Posted August 28, 2012 Share Posted August 28, 2012 Ok thanks man its just because I use the currency item type for a number of others things and it wouldnt work out for me. Thanks for sharing never noticed this bug before Link to comment Share on other sites More sharing options...
Dawntide Posted August 28, 2012 Share Posted August 28, 2012 Tell us what the bug is like. Without this information we can not decide if this fix makes sense. Link to comment Share on other sites More sharing options...
JohnPony Posted August 29, 2012 Author Share Posted August 29, 2012 > Tell us what the bug is like. Without this information we can not decide if this fix makes sense.Seems as though the gold label did not display the amount of gold if it was one, it also only considered items with the index of 1 to be counted as gold. I honestly don't care to investigate any further, someone had trouble in the Q&A board and this fixed it. I don't need your approval, nor do i want it. Link to comment Share on other sites More sharing options...
Alerd Posted October 20, 2012 Share Posted October 20, 2012 this tut for dx8? 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