Kaymak Posted May 13, 2015 Author Share Posted May 13, 2015 Hello Eclipse Community, again i got a slight problem where you can help me out.I want to show the Current Gold in the Players Inventory on the screen.I manage it to make it with following code:```Inventory = 1amount = GetPlayerInvItemValue(MyIndex, Inventory)RenderText Font_Default, amount, X + 100, Y + Height - 1, White```I have 35 Gold in my Inventory, and it shows correclty on the game screen. But when i move the Gold in the Inventory it does show 0 because it is not on the first InventorySlot anymore.So how do i make it that the code looks for the gold in the whole inventory and not only in the slot (my gold is the Item Data1)Thanks for your help! Link to comment Share on other sites More sharing options...
abhi2011 Posted May 13, 2015 Share Posted May 13, 2015 You basically call GetPlayerInvItemNum for every invslot and check if it equals to the Gold's item number (The slot you choose while editing the gold in the item editor). For this example, let's consider that there are 35 inventory slots and that 1 is the Gold's item number.```for i = 1 to 35 if getplayerinvitemnum(myindex, i) = 1 then ' We found the goldamount = getplayerinvitemvalue(myindex, i) exit forend if next```After you get the amount, render it out. In case amount equals 0, this means that there is no gold. You could check for this and not render any text or render "You have no gold" or something. Link to comment Share on other sites More sharing options...
Kaymak Posted May 13, 2015 Author Share Posted May 13, 2015 Ah yea, i fogot about that i = 1 to 35 stuff complelty.@[member="Abhi"] thank you alot senpai! 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