#1
13th Jul 2016 at 6:10 AM
Last edited by pjsutton : 13th Jul 2016 at
4:37 PM.
Posts: 289
Thanks: 1021 in 2 Posts
7 Achievements
How to check if a Sim owns addotional properties
I'm trying to find a way to check if a household owns any additional properties in the current world, and then show a message that displays that at a certain time. I think this might be helpful:
Code:
public static List<LocationHomeDeed> GetAllDeedsForHouseholdForWorld(Household household, WorldName world, bool bIncludeDuplicates)
{
List<LocationHomeDeed> list = new List<LocationHomeDeed>();
if (household != null)
{
Dictionary<ulong, bool> dictionary = new Dictionary<ulong, bool>();
foreach (Sim current in household.Sims)
{
foreach (LocationHomeDeed current2 in current.Inventory.FindAll<LocationHomeDeed>(false))
{
if (current2.World == world && !dictionary.ContainsKey(current2.LotId))
{
if (!bIncludeDuplicates)
{
dictionary.Add(current2.LotId, true);
}
list.Add(current2);
}
}
}
}
return list;
}
But I'm not sure what to do with the parameters. If I run this method, how could I use it to decide if the current household owned something? This seems to me like it would just create a list of who owns properties.
Anyone ever use this before?