Yardım Grid offline shop item arama uyarlama

  • Konuyu açan Konuyu açan layers
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 12
  • Gösterim Gösterim 119
Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

layers

layerswork.com.tr
MT Üye
Mesaj
277
Çözümler
19
Beğeni
206
Puan
414
Ticaret Puanı
0
Merhaba arkadaşlar grid offline shop için item arama sistemini uyarlamak istedim ama bir türlü işaretlemeyi yapamadım

Linkleri görebilmek için giriş yap veya kayıt ol.

buradaki item aramayı aldım

Kod:
Genişlet Daralt Kopyala
    void CShopManager::SearchInShops(LPCHARACTER ch, int vnum)
    {
        if (!ch)
            return;

        if (!CheckSearchTime(ch->GetPlayerID()))
        {
            SendChatPacket(ch, CHAT_PACKET_CANNOT_SEARCH_YET);
            return;
        }

        int foundCount = 0;

        for (auto& kv : m_mapShops)
        {
            CShop& shop = kv.second;
            CShop::VECSHOPITEM* items = shop.GetItems();
            if (!items)
                continue;

            for (const auto& shopItem : *items)
            {
                TItemTable* table = nullptr;
                if (!shopItem.GetTable(&table))
                    continue;

                if ((int)table->dwVnum == vnum)
                {
                    DWORD ownerPID = shop.GetOwnerPID();
                    sys_log(0, "SearchInShops: Checking shop for Owner PID: %u", ownerPID);

                    char shopQuery[512];
                    snprintf(shopQuery, sizeof(shopQuery),
                             "SELECT name, pos_x, pos_y, map_index FROM player.offlineshop_shops WHERE owner_id = %u",
                             ownerPID);
                    std::unique_ptr<SQLMsg> shopMsg(DBManager::instance().DirectQuery(shopQuery));

                    if (shopMsg->Get()->uiNumRows > 0)
                    {
                        MYSQL_ROW shopRow = mysql_fetch_row(shopMsg->Get()->pSQLResult);
                        const char* shopName = shopRow[0] ? shopRow[0] : "Bilinmeyen Shop";
                        long pos_x = shopRow[1] ? strtol(shopRow[1], nullptr, 10) : 0;
                        long pos_y = shopRow[2] ? strtol(shopRow[2], nullptr, 10) : 0;
                        long map_index = shopRow[3] ? strtol(shopRow[3], nullptr, 10) : 0;

                        CTargetManager::Instance().CreateTarget(
                            ch->GetPlayerID(),
                            9999,
                            shopName,
                            3,
                            pos_x,
                            pos_y,
                            map_index,
                            NULL,
                            1
                        );

                        sys_log(0, "SearchInShops: Shop found - Owner PID: %u, Name: %s, MapIndex: %ld, Pos: %ld,%ld",
                                ownerPID, shopName, map_index, pos_x, pos_y);

                        ch->ChatPacket(CHAT_TYPE_INFO, "Bulundu: %s (MapIndex: %d, Pos: %ld,%ld)",
                                       shopName, map_index, pos_x, pos_y);
                    }
                    else
                    {
                        sys_err("SearchInShops: No shop found for Owner PID: %u, SQL Error: %ld", ownerPID,
                                shopMsg->uiSQLErrno);
                        ch->ChatPacket(CHAT_TYPE_INFO, "Shop bilgileri bulunamadı (Owner PID: %u)", ownerPID);
                    }

                    foundCount++;
                    break;
                }
            }
        }

        if (foundCount == 0)
            ch->ChatPacket(CHAT_TYPE_INFO, "Hiç eşleşme bulunamadı.");
        else
            ch->ChatPacket(CHAT_TYPE_INFO, "%d adet eşleşme bulundu.", foundCount);

        m_searchTimeMap[ch->GetPlayerID()] = (DWORD)time(nullptr);
    }
 
client tarafında efekt çıkması için kodlar var onları da uyguladın mı peki?
 
client tarafında efekt çıkması için kodlar var onları da uyguladın mı peki?

karakterin kendini test için ch->GetVID() ile işaretlenmesini sağlamıştım o yüzden client üzerinde olduğu gibi ekledim sanırım bu ch->GetVID() yazdığım yere grid offline shop için yapmam lazım ama gerekli yeride bulamadım
 
karakterin kendini test için ch->GetVID() ile işaretlenmesini sağlamıştım o yüzden client üzerinde olduğu gibi ekledim sanırım bu ch->GetVID() yazdığım yere grid offline shop için yapmam lazım ama gerekli yeride bulamadım
nereye yazdın kodda getvid göremiyorum kaçırıyor muyum ya da
 
yok denerken yazmıştım az önce chatgpt ile uğraşırken burayı değiştirmiş dur örneği atayım

CTargetManager::Instance().CreateTarget(
ch->GetPlayerID(),
9999,
shopName,
3,
ch->GetVID(),
0,
map_index,
NULL,
1
);
bu şekildeyken arıyor ama efekt çıkmıyor değil mi
 
0813_223208.webp


biraz zor oldu ama nihayet oldu pos değerlerini createtargete aktardım normalde vid çekiyordu x ve y değerlerini çekmesi için packete ve client tarafına eklemeler yaptım o şekilde çözdüm konu kapatılabilir
 
Geri
Üst