Jump to content

Strange thing happening with "RemoveAllTypedItems" Function


RyuuDZ

Recommended Posts

So I attempted to create my first script for adding automated sorting for a player home, but I've come across a strange occurrence.

 

Here's a copy of the code. The code itself works perfectly. But the problem is, for example this code, I'm attempting to sort *only* Pre-war money

inside a safe when a button is pressed. When I go in game, press the button, the safe takes everything in the misc typing, *except* the pre-war money.

After realizing the problem, I tested it with bottle caps. Everything in Misc typing goes in the safe, except bottle caps.

 

If anyone knows the issue, I'd be very grateful.


scn ZMKsortCurrencies

short button



Begin OnActivate

showmessage 000zmkMessageSortCurrencies

End


Begin menumode 1001

set button to getbuttonpressed

;wat
if (button == 0)
player.RemoveAllTypedItems 00ZMKRefPreWarMoney 1 0 31 00ZMKFormPrewarMoney
Endif

;why
if (button == 2)
player.RemoveAllTypedItems 00ZMKRefCaps 1 0 31 00ZMKFormCaps
Endif

End
00ZMKFormCaps only has Caps001 in the form
00ZMKFormPrewarMoney only has PrewarMoney in the form

 

Here's two images of the data I have of the safe and switch activator.

 

 

 

 

http://i.imgur.com/sgy0FwI.png

 

 

http://i.imgur.com/xWFOQI4.png

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...