Complete Example Scripts: Difference between revisions
Jump to navigation
Jump to search
m
→Cycle Through a List of Objects and Perform an Action on Each Object(FormLists): Wups. Pulled extra 'EndIf' + reindented
imported>JustinOther m (→Cycle Through a List of Objects and Perform an Action on Each Object(FormLists): Got rid of extraneous var/loop/akReference = ListOfObjectsFLST.GetAt(0) As ObjectReference) |
imported>JustinOther m (→Cycle Through a List of Objects and Perform an Action on Each Object(FormLists): Wups. Pulled extra 'EndIf' + reindented) |
||
| Line 135: | Line 135: | ||
If akActionRef == Game.GetPlayer()) | If akActionRef == Game.GetPlayer()) | ||
iIndex = ListOfObjectsFLST.GetSize() ; Indices are offset by 1 relative to size | iIndex = ListOfObjectsFLST.GetSize() ; Indices are offset by 1 relative to size | ||
While(iIndex > 0) | |||
iIndex -= 1 | |||
akReference = ListOfObjectsFLST.GetAt(iIndex) as ObjectReference ; Note that you must typecast the entry from the formlist using 'As'. | |||
If akReference.IsEnabled() | |||
akReference.Disable() | |||
Else ; If akReference.IsDisabled() | |||
akReference.Enable() | |||
EndIf | |||
EndWhile | |||
EndIf | EndIf | ||
EndEvent</source> | EndEvent</source> | ||