Hikayeler

Reklam vermek için turkmmo@gmail.com

ITEM_GIFTBOX ( Sandık'dan İtem Çıkınca Duyuru ) C++

Metin2 EP, Valorant VP dahil tüm oyun ürünlerini en uygun fiyatlarla bulabilir, Item ve Karakterlerinizi hızlıca satabilirsiniz. HEMEN TIKLA!

Paylaşım için teşekkür ederim fakat bu şekilde duyuru oluyor nasıl düzeltebilirim

Screenshot_1.png
 
if (dwVnums == 71084 || dwVnums == 183 || dwVnums == 3160 || dwVnums == 2172 || dwVnums == 1130 || dwVnums == 5120)

buradaki kodlar yazmanız lazım.
 
if (dwVnums == 71084 || dwVnums == 183 || dwVnums == 3160 || dwVnums == 2172 || dwVnums == 1130 || dwVnums == 5120)
Screenshot_2.png

buradaki kodlar yazmanız lazım.
bu şekilde kod
 
Kodun her çalışmasında set yeniden oluşmaz performans artar bu şekilde ve temize kontrollü static const olarak çektim.

C++:
if (!item_gets[i])
    return;

if (dwCounts[i] > 1)
    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼ %s °¡ %d °³ ³ª¿Ô½À´Ï´Ù."), item_gets[i]->GetName(), dwCounts[i]);
else
    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼ %s °¡ ³ª¿Ô½À´Ï´Ù."), item_gets[i]->GetName());

static const std::unordered_set<DWORD> kAnnounceItems = {
    183,
    71084,
    3160,
    2172,
    1130,
    5120
};

if (kAnnounceItems.find(dwVnums[i]) != kAnnounceItems.end())
{
    char szBuf[256];
    snprintf(szBuf, sizeof(szBuf), "%s, %s sandığından %s kazandı!", GetName(), item->GetName(), item_gets[i]->GetName());
    BroadcastNotice(szBuf);
}
 
Kodun her çalışmasında set yeniden oluşmaz performans artar bu şekilde ve temize kontrollü static const olarak çektim.

C++:
if (!item_gets[i])
    return;

if (dwCounts[i] > 1)
    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼ %s °¡ %d °³ ³ª¿Ô½À´Ï´Ù."), item_gets[i]->GetName(), dwCounts[i]);
else
    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼ %s °¡ ³ª¿Ô½À´Ï´Ù."), item_gets[i]->GetName());

static const std::unordered_set<DWORD> kAnnounceItems = {
    183,
    71084,
    3160,
    2172,
    1130,
    5120
};

if (kAnnounceItems.find(dwVnums[i]) != kAnnounceItems.end())
{
    char szBuf[256];
    snprintf(szBuf, sizeof(szBuf), "%s, %s sandığından %s kazandı!", GetName(), item->GetName(), item_gets[i]->GetName());
    BroadcastNotice(szBuf);
}

Eline Sağlık
 

Şu an konuyu görüntüleyenler (Toplam : 1, Üye: 0, Misafir: 1)

Geri
Üst