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

Werid by pass


dragonlord52
 Share

Recommended Posts

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 = Amount
End 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

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