Skip to content

OnApartmentMasterKeyPurchased

Usage

  • No return behavior

Example Autogenerated

csharp
private void OnApartmentMasterKeyPurchased( BasePlayer player, Item item )
{
    Puts( "OnApartmentMasterKeyPurchased works!" );
}

Location

  • NPCApartmentSecurity::OnPurchaseKey(BasePlayer player, UnityEngine.Vector3 position)
csharp
//---
		Item item = ItemManager.Create(masterKeyDef, 1, 0uL, isServerSide: true, 0uL);
		if (item != null)
		{
			item.AddItemOwnership(player, ItemOwnershipPhrases.VendorSale);
			player.GiveItem(item, GiveItemReason.PickedUp);
			Interface.CallHook("OnApartmentMasterKeyPurchased", player, item);
		}
	}
}

Released under the MIT License.