I have an issue with a script that don't return "1" when searching an armor in a list ...
I first create a list with the item outfitmerc01 (hereticuslist)
An object , when added to an npc inventory do this :
scn nonworkingscript
ref contid
ref armor
begin onadd
set contid to getcontainer ;catch the npc id that have the object
set armor to contid.getequippedobject 2 ; catch the id of the npc armor (NVSE function)
if armor.isinlist hereticuslist ; show the message "test" if the armor is in the list
showmessage test
endif
end
ref contid
ref armor
begin onadd
set contid to getcontainer ;catch the npc id that have the object
set armor to contid.getequippedobject 2 ; catch the id of the npc armor (NVSE function)
if armor.isinlist hereticuslist ; show the message "test" if the armor is in the list
showmessage test
endif
end
But it don't work at all
BUT , if i do this :
if armor == outfitmerc01
showmessage test
endif
showmessage test
endif
It work , but the list of armors is realy long so the code is not optimized and it's more difficult for me to manage it with the entire code ... a list with all armors is realy better !
Thanks in advance ,
Hereticus
