| 
				
				В чем ошибка?
				 |   |  
| KpayTeJIb | Дата: Четверг, 16 Декабря 2010, 18:31 | Сообщение # 1 |  
 
был не раз 
Сейчас нет на сайте 
 
 | хочу вставить скрипт крафт но не работает, в начале пишут что надо написать вот этот скрипт в ScriptedItem:   Code Case 10   If CheckItem(index, 2) = 1 Then   If CheckItem(index, 3) = 1 Then   Call TakeItem(index, 2, "all")   Call TakeItem(index, 3, "all")   Call GiveItem(index, 4, 0)   Call PlayerMsg(index, "You gained a shield.", 12)   Else   Call PlayerMsg(index, "You need the left side of the shield.", 12)   End If   End If   Case 11   If CheckItem(index, 3) = 1 Then   If CheckItem(index, 2) = 1 Then   Call TakeItem(index, 3, "all")   Call TakeItem(index, 2, "all")   Call GiveItem(index, 4, 0)   Call PlayerMsg(index, "You gained a shield.", 12)   Else   Call PlayerMsg(index, "You need the right side of the shield.", 12)   End If   End If   End Select   End Sub     Но там уже было написано:   Code Select Case Script      Case 0       Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE) 
       Exit Sub 
      Case Else       Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE)        Exit Sub   End Select   End sub     Вставил 1 скрипт послe exit sub.  Мб в main не правильно что то вписал?   main:   http://depositfiles.com/files/tpntfog3o 
 
 Сообщение отредактировал KpayTeJIb - Четверг, 16 Декабря 2010, 18:43  |  
| 
 | 
 |    |  
| Fulier | Дата: Четверг, 16 Декабря 2010, 19:45 | Сообщение # 2 |  
 
постоянный участник 
Сейчас нет на сайте 
 
 | Это на какую версию Eclipse? Да и скрипт не особо правильно сделан. После Case 10 нет, например, Exit Sub. CheckItem - сомневаюсь в этой команде.   Сомневаюсь и здесь: TakeItem(index, 3, "all")   В общем скрипт неверен. Одно только отсутствие Exit Sub настораживает.
  Лампа. Кофе. Игра. - сайт о компьютерных, компьютерных и еще раз компьютерных играх.
 
 Сообщение отредактировал Fulier - Четверг, 16 Декабря 2010, 19:48  |  
| 
 | 
 |    |  
| infermik | Дата: Пятница, 17 Декабря 2010, 09:05 | Сообщение # 3 |  
 
заслуженный участник 
Сейчас нет на сайте 
 
 | Fulier Эти команды такие как CheckItem TakeItem GiveCurensy и т.п сделаны Godlord'ом т.е пользовательские (Это так называемый скрипт инвентаря) они должны быть вставлены в main.txt TakeItem(index, 3, "all") эта функция All подразумевает, что не 1 предмет будет сделан, а все если есть нужные компоненты. Добавлено (17.12.2010, 09:05) --------------------------------------------- Вот я добавлю этот скрипт    Code Function GetFreeSlots(Index)               Dim Slot          Dim Slots 
          Slot = 1          Slots = 0                    Index = Int(Index) 
          Do While Slot < 25                If GetPlayerInvItemNum(Index, Slot) = 0 Then                Slots = Slots + 1             End If 
             Slot = Slot + 1          Loop 
          GetFreeSlots = Slots       End Function 
       Sub GiveItem(Index, Number, Durability)          Dim Slot                    Slot = 1                    Index = Int(Index)          Number = Int(Number)          Durability = Int(Durability)                    Do While Slot < 25             If GetPlayerInvItemNum(Index, Slot) = 0 Then                Call SetPlayerInvItemNum(Index, Slot, Number)                Call SetPlayerInvItemDur(Index, Slot, Durability)                Call SendInventoryUpdate(Index, Slot)                Exit Sub             End If                         Slot = Slot + 1          Loop       End Sub 
       Sub GiveCurrency(Index, Number, Amount)          Dim Slot          Dim CurrentAmount                    Slot = 1                    Index = Int(Index)          Number = Int(Number)          Amount = Int(Amount)                    Do While Slot < 25              If GetPlayerInvItemNum(Index, Slot) = Number Then                 CurrentAmount = GetPlayerInvItemValue(Index, Slot)                 Call SetPlayerInvItemValue(Index, Slot, CurrentAmount + Amount)                 Call SendInventoryUpdate(Index, Slot)                 Exit Sub              End If                          Slot = Slot + 1          Loop                         Slot = 1 
          Do While Slot < 25              If GetPlayerInvItemNum(Index, Slot) = 0 Then                 Call SetPlayerInvItemNum(Index, Slot, Number)                 Call SetPlayerInvItemValue(Index, Slot, Amount)                 Call SendInventoryUpdate(Index, Slot)                 Exit Sub              End If                          Slot = Slot + 1          Loop       End Sub 
       Function CanTake(Index, Number, Amount)          Dim Slot                    Slot = 1                    Index = Int(Index)          Number = Int(Number)          Amount = Int(Amount)                    Do While Slot < 25             If GetPlayerInvItemNum(Index, Slot) = Number Then                If GetPlayerInvItemValue(Index, Slot) >= Amount Then                   CanTake = True                   Exit Function                End If             End If                         Slot = Slot + 1          Loop                    CanTake = False       End Function 
       Sub TakeItem(Index, Number, Amount)          Dim Slot          Dim CurrentAmount 
          Index = Int(Index)          Number = Int(Number)          Amount = Int(Amount)                    Slot = 1                    Do While Slot < 25              If GetPlayerInvItemNum(Index, Slot) = Number Then                 If GetPlayerInvItemValue(Index, Slot) >= Amount Then                    CurrentAmount = GetPlayerInvItemValue(Index, Slot)                                        If CurrentAmount <= Amount Then                       Call SetPlayerInvItemNum(Index, Slot, 0)                       Call SetPlayerInvItemValue(Index, Slot, 0)                       Call SetPlayerInvItemDur(Index, Slot, 0)                       Call SendInventoryUpdate(Index, Slot)                    Else                       Call SetPlayerInvItemValue(Index, Slot, CurrentAmount - Amount)                       Call SendInventoryUpdate(Index, Slot)                    End If                                        Exit Sub                 End If              End If                          Slot = Slot + 1          Loop       End Sub  
  Выпрямляю путем кнута и пряника    
 |  
| 
 | 
 |    |  
| Fulier | Дата: Пятница, 17 Декабря 2010, 13:16 | Сообщение # 4 |  
 
постоянный участник 
Сейчас нет на сайте 
 
 | infermik, Я про эти скрипты знаю, но CheckItem - такого у Godlorda нет, есть CanTake   All? Не смешите меня, тут должна быть цифра обязательно, ибо Amount as Long, а не String.  TakeItem - это не сделать/выдать предмет, а наоборот забрать его из инвентаря.   Добавлено (17.12.2010, 13:16)   ---------------------------------------------   Идём дальше:   Call GiveItem(index, 4, 0) - здесь 0 - это прочность предмета, если это щит или оружие. 
  Лампа. Кофе. Игра. - сайт о компьютерных, компьютерных и еще раз компьютерных играх.
 
 Сообщение отредактировал Fulier - Пятница, 17 Декабря 2010, 13:17  |  
| 
 | 
 |    |  
| denis007 | Дата: Пятница, 17 Декабря 2010, 22:36 | Сообщение # 5 |  
| 
 частый гость 
Сейчас нет на сайте 
 
 | Слышьте к этому коду дайте остальные кода   в смысле кода каторые в касе надо кидать   Quote (infermik) Function GetFreeSlots(Index)   Dim Slot   Dim Slots   Slot = 1   Slots = 0   Index = Int(Index)   Do While Slot < 25   If GetPlayerInvItemNum(Index, Slot) = 0 Then   Slots = Slots + 1   End If   Slot = Slot + 1   Loop   GetFreeSlots = Slots   End Function   Sub GiveItem(Index, Number, Durability)   Dim Slot   Slot = 1   Index = Int(Index)   Number = Int(Number)   Durability = Int(Durability)   Do While Slot < 25   If GetPlayerInvItemNum(Index, Slot) = 0 Then   Call SetPlayerInvItemNum(Index, Slot, Number)   Call SetPlayerInvItemDur(Index, Slot, Durability)   Call SendInventoryUpdate(Index, Slot)   Exit Sub   End If   Slot = Slot + 1   Loop   End Sub   Sub GiveCurrency(Index, Number, Amount)   Dim Slot   Dim CurrentAmount   Slot = 1   Index = Int(Index)   Number = Int(Number)   Amount = Int(Amount)   Do While Slot < 25   If GetPlayerInvItemNum(Index, Slot) = Number Then   CurrentAmount = GetPlayerInvItemValue(Index, Slot)   Call SetPlayerInvItemValue(Index, Slot, CurrentAmount + Amount)   Call SendInventoryUpdate(Index, Slot)   Exit Sub   End If   Slot = Slot + 1   Loop   Slot = 1   Do While Slot < 25   If GetPlayerInvItemNum(Index, Slot) = 0 Then   Call SetPlayerInvItemNum(Index, Slot, Number)   Call SetPlayerInvItemValue(Index, Slot, Amount)   Call SendInventoryUpdate(Index, Slot)   Exit Sub   End If   Slot = Slot + 1   Loop   End Sub   Function CanTake(Index, Number, Amount)   Dim Slot   Slot = 1   Index = Int(Index)   Number = Int(Number)   Amount = Int(Amount)   Do While Slot < 25   If GetPlayerInvItemNum(Index, Slot) = Number Then   If GetPlayerInvItemValue(Index, Slot) >= Amount Then   CanTake = True   Exit Function   End If   End If   Slot = Slot + 1   Loop   CanTake = False   End Function   Sub TakeItem(Index, Number, Amount)   Dim Slot   Dim CurrentAmount   Index = Int(Index)   Number = Int(Number)   Amount = Int(Amount)   Slot = 1   Do While Slot < 25   If GetPlayerInvItemNum(Index, Slot) = Number Then   If GetPlayerInvItemValue(Index, Slot) >= Amount Then   CurrentAmount = GetPlayerInvItemValue(Index, Slot)   If CurrentAmount <= Amount Then   Call SetPlayerInvItemNum(Index, Slot, 0)   Call SetPlayerInvItemValue(Index, Slot, 0)   Call SetPlayerInvItemDur(Index, Slot, 0)   Call SendInventoryUpdate(Index, Slot)   Else   Call SetPlayerInvItemValue(Index, Slot, CurrentAmount - Amount)   Call SendInventoryUpdate(Index, Slot)   End If   Exit Sub   End If   End If   Slot = Slot + 1   Loop   End Sub  
 
 Сообщение отредактировал denis007 - Суббота, 18 Декабря 2010, 11:31  |  
| 
 | 
 |    |     
		
		 
 |