Difference between revisions of "RemoveItem"

927 bytes added ,  15:35, 23 January 2008
→‎Notes: Refresh and lag
imported>Fella
imported>Haama
(→‎Notes: Refresh and lag)
Line 28: Line 28:
Message " "
Message " "
player.RemoveItem "item ID" 1</pre>
player.RemoveItem "item ID" 1</pre>
This seems to shortcircuit the message display and will prevent any other messages from being queued or displayed for a couple of seconds. [[Avoiding Message Spam|Here]] are some alternative methods that don't disrupt other messages.
**This seems to shortcircuit the message display and will prevent any other messages from being queued or displayed for a couple of seconds. [[Avoiding Message Spam|Here]] are some alternative methods that don't disrupt other messages.
 
*When you remove an item while the player's inventory menu ([[MenuMode]] 1002) is open, the item will remain visible even though it's really not there. To refresh the menu after removing the item, use
<pre>player.AddItem YourMiscItem 1
player.EquipItem YourMiscItem
player.UnEquipItem YourMiscItem
player.RemoveItem YourMiscItem 1</pre>
**If the menu has been hidden with '''con_ToggleMenus''' (either via script or console) this will not work.
*When you remove a large number of unique items from the player while their inventory menu is open, there may be some lag. You can prevent this with OBSE's [[con_ToggleMenus]] by placing it on both sides of the remove lines:
<pre>con_ToggleMenus
player.RemoveItem SomeItem001 1
...
player.RemoveItem SomeItem100 1
con_ToggleMenus
;Refresh the menu
player.AddItem YourMiscItem 1
player.EquipItem YourMiscItem
player.UnEquipItem YourMiscItem
player.RemoveItem YourMiscItem 1</pre>


==See Also==
==See Also==
Anonymous user