i dont know what went wrong but all the item says null as shown in the picture anyone know the fix ? might be helpful for me Thanks !
My guess the problem is in this code
My guess the problem is in this code
C#:
public static void OpenBizShopMenu(ExtPlayer player)
{
try
{
var sessionData = player.GetSessionData();
if (sessionData == null) return;
if (!player.IsCharacterData()) return;
if (sessionData.BizID == -1 || !BizList.ContainsKey(sessionData.BizID)) return;
var biz = BizList[sessionData.BizID];
var jsonData = new List<Fractions.Manager.FracMatsData>();
int index = 0;
foreach (var p in biz.Products)
{
var busProductData = BusProductsData[p.Name];
if (busProductData.ItemId != ItemId.Debug) jsonData.Add(new Fractions.Manager.FracMatsData(index, Chars.Repository.ItemsInfo[busProductData.ItemId].Name, Chars.Repository.ItemsInfo[busProductData.ItemId].Icon, $"{p.Price}$", (int)busProductData.ItemId));
//else if (p.Name == "SIM Card") jsonData.Add(new Fractions.Manager.FracMatsData(index, "SIM Card", "sm-icon-sim", $"{p.Price}$" ));
//else if (p.Name == "Lottery ticket") jsonData.Add(new Fractions.Manager.FracMatsData(index, "Lottery ticket", "sm-icon-lotary", $"{p.Price}$" ));
index++;
}
// Console.WriteLine("" + JsonConvert.SerializeObject(jsonData))
Trigger.ClientEvent(player, "client.sm.openShop", JsonConvert.SerializeObject(jsonData));
}
catch (Exception e)
{
Log.Write($"OpenBizShopMenu Exception: {e.ToString()}");
}
}
Последнее редактирование: