Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code Error
#1
I'm getting "Case without Select Case" (the bolded case is what its highlighting)

Code:
' Check to see if its any sort of ArmorSlot/WeaponSlot
                Select Case Item(GetPlayerInvItemNum(index, InvNum)).Type
                    Case ITEM_TYPE_ARMOR
                        If InvNum = GetPlayerEquipmentSlot(index, Armor) Then
                            Call SetPlayerEquipmentSlot(index, 0, Armor)
                            Call SendWornEquipment(index)
                        End If
                        MapItem(GetPlayerMap(index), i).Dur = GetPlayerInvItemDur(index, InvNum)
                    
                    Case ITEM_TYPE_WEAPON
                        If Item(GetPlayerInvItemNum(index, InvNum)).TwoHanded < 1 Then
                          If InvNum = GetPlayerEquipmentSlot(index, Weapon) Then
                                Call SetPlayerEquipmentSlot(index, 0, Weapon)
                                Call SendWornEquipment(index)
                          End If
                                MapItem(GetPlayerMap(index), i).Dur = GetPlayerInvItemDur(index, InvNum)
                        If InvNum = GetPlayerEquipmentSlot(index, Weapon) Then
                            Call SetPlayerEquipmentSlot(index, 0, Weapon)
                            Call SendWornEquipment(index)
                        End If
                        MapItem(GetPlayerMap(index), i).Dur = GetPlayerInvItemDur(index, InvNum)
                        
                    [b]Case[/b] ITEM_TYPE_HELMET
                        If InvNum = GetPlayerEquipmentSlot(index, Helmet) Then
                            Call SetPlayerEquipmentSlot(index, 0, Helmet)
                            Call SendWornEquipment(index)
                        End If
                        MapItem(GetPlayerMap(index), i).Dur = GetPlayerInvItemDur(index, InvNum)
                                        
                    Case ITEM_TYPE_SHIELD
                        If InvNum = GetPlayerEquipmentSlot(index, Shield) Then
                            Call SetPlayerEquipmentSlot(index, 0, Shield)
                            Call SendWornEquipment(index)
                        End If
                        MapItem(GetPlayerMap(index), i).Dur = GetPlayerInvItemDur(index, InvNum)
                End Select

Any fix?
Reply
#2
You have too many

Code:
End If
's
Reply
#3
No, he is missing an End if.

Code:
Case ITEM_TYPE_WEAPON
                        If Item(GetPlayerInvItemNum(index, InvNum)).TwoHanded < 1 Then
                          If InvNum = GetPlayerEquipmentSlot(index, Weapon) Then
                                Call SetPlayerEquipmentSlot(index, 0, Weapon)
                                Call SendWornEquipment(index)
                          End If
                                MapItem(GetPlayerMap(index), i).Dur = GetPlayerInvItemDur(index, InvNum)
                        If InvNum = GetPlayerEquipmentSlot(index, Weapon) Then
                            Call SetPlayerEquipmentSlot(index, 0, Weapon)
                            Call SendWornEquipment(index)
                        End If
                        MapItem(GetPlayerMap(index), i).Dur = GetPlayerInvItemDur(index, InvNum)
Reply
#4
Works now, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)