UnequipAllItemsUDF

From GECK
Jump to: navigation, search


An example UDF script.

Description

Unequips all equipped items from an Actor that have an equip slot.

Syntax

[help]
actorRef.call UnequipAllItemsUDF

Example

playerRef.call UnequipAllItemsUDF
player.call UnequipAllItemsUDF  ;in scripts, there is almost never a difference between "player" and "playerref"
SunnyRef.call UnequipAllItemsUDF  ;works on other actors. 

Script

To use this function, copy the following code into a new object script:

scn UnequipAllItemsUDF

int iIndex
ref rItem

Begin Function{}
    let iIndex := -1
    while (iIndex += 1) <= 19  ;go through all the equip slots
      let rItem := GetEquippedObject iIndex
      if IsFormValid rItem
        UnequipItemAlt rItem 0 1  ;Hide unequip message.
      endif
    loop
End

Notes

See Also