dragonlord52 Posted December 18, 2009 Author Share Posted December 18, 2009 For some reason, even if I don't have items in my inventory, the script still by passes this if statement``` 'CHECK FOR REQUIRED ITEMS If (CountPlayerInvItem(Index, 1) < 0) Then Call PlayerMsg(Index, "1", 14) If (Req_Items = 2) Then If (CountPlayerInvItem(Index, Req_2_Num) = Req_2_Val) Then has_items = 1 End If Else has_items = 1 End If Else Call PlayerMsg(Index, "0", 14) has_items = 0 End If```This is the CountPlayerInvItem thing from Goddie```'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function: CountPlayerInvItem '' Brief: counts an item in the inventory. '' Parameters: '' Index: the index number of the player. '' Item: the item to count. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Function CountPlayerInvItem(Index, Item) For Slot = 1 To MAX_INVSLOTS If GetPlayerInvItemNum(Index, Slot) = Item Then If GetPlayerInvItemValue(Index, Slot) = 0 Then Amount = Amount + 1 Else Amount = Amount + GetPlayerInvItemValue(Index, Slot) End If End If Next CountPlayerInvItem = AmountEnd Function```I'm not really sure how its happening and when I use PlayerMsg to help me debug it appears to just be a blank message. Any ideas? Link to comment Share on other sites More sharing options...
dragonlord52 Posted December 19, 2009 Author Share Posted December 19, 2009 Figured out why, non-stackables come out as 0 in terms of value 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