scn AZGoldContainer1
short act
short gld
short itm
short button
Begin MenuMode 1008
If itm == 0
Set itm to GetItemCount DarkInfernalFrost
Set gld to itm * 7000
Set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount GoblinShamanStaff
set gld to gld + itm * 6550
set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount UniqueWeapHatred
set gld to gld + itm * 6200
set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount SEAmberMagicHammer5
set gld to gld + itm * 6100
set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount SEAmberHammer5
set gld to gld + itm * 6100
set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount SEWeapDaedricWarHammerDurable
set gld to gld + itm * 6000
set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount SE11ShadowBlade30
set gld to gld + itm * 6000
set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount SE11ShadowAxe30
set gld to gld + itm * 6000
set itm to 0
EndIf
if gld > 0
Set act to 1
EndIf
End
Begin GameMode
If act == 1
messagebox "продать все вещи за %5.0f золотых", gld, "продать", "не продавать"
Set act to 2
EndIf
End
Begin GameMode
If act == 2
Set button to GetButtonPressed
if button == -1
return
ElseIf button == 0
RemoveAllItems
Player.additem gold001 gld
set act to 0
Else
RemoveAllItems Player
set act to 0
EndIf
EndIf
End
вообщем когда я ставлю скрипт тот что сверху все норм и работает как надо, но если писать отдельный блок If EndIf для каждой вещи то получается просто огромная портянка, и я подумал почему бы не объединить вещи с одинаковой стоимостью в один блок If EndIf и вот что у меня получилось
scn AZGoldContainer1
short act
short gld
short itm
short button
Begin MenuMode 1008
If itm == 0
Set itm to GetItemCount DarkInfernalFrost
Set gld to itm * 7000
Set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount GoblinShamanStaff
set gld to gld + itm * 6550
set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount UniqueWeapHatred
set gld to gld + itm * 6200
set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount SEAmberMagicHammer5
set gld to gld + itm * 6100
set itm to 0
EndIf
If itm == 0
Set itm to GetItemCount SEAmberHammer5
set gld to gld + itm * 6100
set itm to 0
EndIf
If itm == 0
Set itm to ( GetItemCount SEWeapDaedricWarHammerDurable + GetItemCount SE11ShadowBlade30 + GetItemCount SE11ShadowAxe30 )
; в пред идущем блоке я объединил то что в первом скрипте я записывал в отдельный блок
set gld to gld + itm * 6000
set itm to 0
EndIf
if gld > 0
Set act to 1
EndIf
End
Begin GameMode
If act == 1
messagebox "продать все вещи за %5.0f золотых", gld, "продать", "не продавать"
Set act to 2
EndIf
End
Begin GameMode
If act == 2
Set button to GetButtonPressed
if button == -1
return
ElseIf button == 0
RemoveAllItems
Player.additem gold001 gld
set act to 0
Else
RemoveAllItems Player
set act to 0
EndIf
EndIf
End
И второй скрипт заработал!! все считалось добавлялось удалялось как надо, но почему то если загрузить снова то же сохранение что и раньше то скрипт уже не работает!!! в чем может быть проблема???