Hikayeler

Reklam vermek için turkmmo@gmail.com
Kaynak ikonu

promotional code system 1

indirmek için izniniz yok

malin493

Level 1
Üye
Katılım
7 Tem 2021
Konular
6
Mesajlar
21
Online süresi
7g 59481s
Reaksiyon Skoru
33
Altın Konu
0
Başarım Puanı
51
TM Yaşı
4 Yıl 9 Ay 18 Gün
MmoLira
2,275
DevLira
18

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

1625652465351.png

download:
scan:
Thanks .Atom for this system :)
 

En Çok Reaksiyon Alan Mesajlar

bug after you enter the promo code, and press ok, it just hide the window, but the input text doenst stop and it recive txt

edit.
fixed it

def Close(self):
self.ClickClear()
self.promo_code.KillFocus()

wndMgr.Hide(self.hWnd)

edit2. fix coins update and add special inventory and gaya and won

fix:
void CHARACTER::give_PromoCodeSystem(const std::string& sType, int iVnum, int iCount)
{
    if (!sType.compare("item"))
    {
        LPITEM itemReward = ITEM_MANAGER::instance().CreateItem(iVnum, iCount, 0, true);
      
        if (itemReward)
        {
            int iEmptyPos;
            if (itemReward->IsDragonSoul())
                iEmptyPos = GetEmptyDragonSoulInventory(itemReward);
            else if (itemReward->IsUpgradeItem())
                iEmptyPos = GetEmptyUpgradeInventory(itemReward);
            else if (itemReward->IsBook())
                iEmptyPos = GetEmptyBookInventory(itemReward);
            else if (itemReward->IsStone())
                iEmptyPos = GetEmptyStoneInventory(itemReward);
            else
                iEmptyPos = GetEmptyInventory(itemReward->GetSize());
          
            if (iEmptyPos != -1)
            {
                if (itemReward->IsDragonSoul())
                    itemReward->AddToCharacter(this, TItemPos(DRAGON_SOUL_INVENTORY, iEmptyPos));
    [HASH=2]#ifdef[/HASH] ENABLE_SPECIAL_STORAGE
                else if (itemReward->IsUpgradeItem())
                    itemReward->AddToCharacter(this, TItemPos(UPGRADE_INVENTORY, iEmptyPos));
                else if (itemReward->IsBook())
                    itemReward->AddToCharacter(this, TItemPos(BOOK_INVENTORY, iEmptyPos));
                else if (itemReward->IsStone())
                    itemReward->AddToCharacter(this, TItemPos(STONE_INVENTORY, iEmptyPos));
    [HASH=3]#endif[/HASH]
                else
                    itemReward->AddToCharacter(this, TItemPos(INVENTORY, iEmptyPos));
            }
            else
            {
                PIXEL_POSITION pos;
                  
                if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
                    return;
                  
                pos.x = number(-10, 10) * 20;
                pos.y = number(-10, 10) * 20;
                  
                pos.x += GetX();
                pos.y += GetY();
                  
                itemReward->AddToGround(GetMapIndex(), pos);
                itemReward->StartDestroyEvent();
            }
              
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %s , %d bucati."), itemReward->GetName(), iCount);
        }
    }
  
    else if (!sType.compare("gold"))
    {
        const int64_t TotalMoney = static_cast<int64_t>(GetGold()) + static_cast<int64_t>(iCount);
      
        if (TotalMoney >= GOLD_MAX)
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea mult yang!"));
            return;
        }
      
        PointChange(POINT_GOLD, iCount, true);
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d yang!"), iCount);
    }
    [HASH=2]#ifdef[/HASH] ENABLE_PROMO_CODE_WON
    else if(!sType.compare("won"))
    {
        const int64_t TotalCheque = static_cast<int64_t>(GetCheque()) + static_cast<int64_t>(iCount);
        if (TotalCheque >= CHEQUE_MAX)
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea multi woni!"));
            return;
        }
      
        PointChange(POINT_CHEQUE, iCount, true);
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d won(i)!"), iCount);
    }
    [HASH=3]#endif[/HASH]
  
    [HASH=2]#ifdef[/HASH] ENABLE_PROMO_CODE_GEM
    else if(!sType.compare("gaya"))
    {
        const int64_t TotalGem = static_cast<int64_t>(GetGem()) + static_cast<int64_t>(iCount);
        if (TotalGem >= GEM_MAX)
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea multe puncte gaya!"));
            return;
        }
      
        PointChange(POINT_GEM, iCount, true);
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d gaya!"), iCount);
    }
    [HASH=3]#endif[/HASH]
  
    else if (!sType.compare("coins"))
    {
        DBManager::instance().Query("UPDATE account.account SET coins=coins + '%d' WHERE id = '%d'", iCount, GetDesc()->GetAccountTable().id);
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d monede dragon!"), iCount);
    }
  
    else if (!sType.compare("level"))
    {
        int idx = 0;
      
        while (idx < iCount)
        {
            PointChange(POINT_EXP, GetNextExp());
            idx++;
        }
      
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d niveluri suplimentare!"), iCount);
    }
}
[HASH=3]#endif[/HASH]


edit3, added name and ip into restriction

fix:
void CHARACTER::lock_PromoCodeSystem(const char * promo_code)
{
    char szQuery[256];
    
    std::auto_ptr<SQLMsg> pMsg1(DBManager::instance().DirectQuery("SELECT ip FROM player.player WHERE account_id = '%d'", GetDesc()->GetAccountTable().id));
    MYSQL_ROW row = mysql_fetch_row(pMsg1->Get()->pSQLResult);
            
    if (pMsg1->uiSQLErrno != 0 || !pMsg1->Get()->uiNumRows)
        return;
    
    snprintf(szQuery, sizeof(szQuery), "INSERT INTO player.promo_code_restriction SET account_id = '%d', player_name = '%s', promo_code = '%s', ip = '%s'", GetDesc()->GetAccountTable().id, GetName(), promo_code, row[0]);
    std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(szQuery));
}
bug after you enter the promo code, and press ok, it just hide the window, but the input text doenst stop and it recive txt

edit.
fixed it

def Close(self):
self.ClickClear()
self.promo_code.KillFocus()

wndMgr.Hide(self.hWnd)

edit2. fix coins update and add special inventory and gaya and won

fix:
void CHARACTER::give_PromoCodeSystem(const std::string& sType, int iVnum, int iCount)
{
    if (!sType.compare("item"))
    {
        LPITEM itemReward = ITEM_MANAGER::instance().CreateItem(iVnum, iCount, 0, true);
      
        if (itemReward)
        {
            int iEmptyPos;
            if (itemReward->IsDragonSoul())
                iEmptyPos = GetEmptyDragonSoulInventory(itemReward);
            else if (itemReward->IsUpgradeItem())
                iEmptyPos = GetEmptyUpgradeInventory(itemReward);
            else if (itemReward->IsBook())
                iEmptyPos = GetEmptyBookInventory(itemReward);
            else if (itemReward->IsStone())
                iEmptyPos = GetEmptyStoneInventory(itemReward);
            else
                iEmptyPos = GetEmptyInventory(itemReward->GetSize());
          
            if (iEmptyPos != -1)
            {
                if (itemReward->IsDragonSoul())
                    itemReward->AddToCharacter(this, TItemPos(DRAGON_SOUL_INVENTORY, iEmptyPos));
    [HASH=2]#ifdef[/HASH] ENABLE_SPECIAL_STORAGE
                else if (itemReward->IsUpgradeItem())
                    itemReward->AddToCharacter(this, TItemPos(UPGRADE_INVENTORY, iEmptyPos));
                else if (itemReward->IsBook())
                    itemReward->AddToCharacter(this, TItemPos(BOOK_INVENTORY, iEmptyPos));
                else if (itemReward->IsStone())
                    itemReward->AddToCharacter(this, TItemPos(STONE_INVENTORY, iEmptyPos));
    [HASH=3]#endif[/HASH]
                else
                    itemReward->AddToCharacter(this, TItemPos(INVENTORY, iEmptyPos));
            }
            else
            {
                PIXEL_POSITION pos;
                  
                if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
                    return;
                  
                pos.x = number(-10, 10) * 20;
                pos.y = number(-10, 10) * 20;
                  
                pos.x += GetX();
                pos.y += GetY();
                  
                itemReward->AddToGround(GetMapIndex(), pos);
                itemReward->StartDestroyEvent();
            }
              
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %s , %d bucati."), itemReward->GetName(), iCount);
        }
    }
  
    else if (!sType.compare("gold"))
    {
        const int64_t TotalMoney = static_cast<int64_t>(GetGold()) + static_cast<int64_t>(iCount);
      
        if (TotalMoney >= GOLD_MAX)
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea mult yang!"));
            return;
        }
      
        PointChange(POINT_GOLD, iCount, true);
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d yang!"), iCount);
    }
    [HASH=2]#ifdef[/HASH] ENABLE_PROMO_CODE_WON
    else if(!sType.compare("won"))
    {
        const int64_t TotalCheque = static_cast<int64_t>(GetCheque()) + static_cast<int64_t>(iCount);
        if (TotalCheque >= CHEQUE_MAX)
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea multi woni!"));
            return;
        }
      
        PointChange(POINT_CHEQUE, iCount, true);
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d won(i)!"), iCount);
    }
    [HASH=3]#endif[/HASH]
  
    [HASH=2]#ifdef[/HASH] ENABLE_PROMO_CODE_GEM
    else if(!sType.compare("gaya"))
    {
        const int64_t TotalGem = static_cast<int64_t>(GetGem()) + static_cast<int64_t>(iCount);
        if (TotalGem >= GEM_MAX)
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu puteti folosi acest cod promotional pentru ca ati avea prea multe puncte gaya!"));
            return;
        }
      
        PointChange(POINT_GEM, iCount, true);
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d gaya!"), iCount);
    }
    [HASH=3]#endif[/HASH]
  
    else if (!sType.compare("coins"))
    {
        DBManager::instance().Query("UPDATE account.account SET coins=coins + '%d' WHERE id = '%d'", iCount, GetDesc()->GetAccountTable().id);
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d monede dragon!"), iCount);
    }
  
    else if (!sType.compare("level"))
    {
        int idx = 0;
      
        while (idx < iCount)
        {
            PointChange(POINT_EXP, GetNextExp());
            idx++;
        }
      
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Codul promotional continea: %d niveluri suplimentare!"), iCount);
    }
}
[HASH=3]#endif[/HASH]


edit3, added name and ip into restriction

fix:
void CHARACTER::lock_PromoCodeSystem(const char * promo_code)
{
    char szQuery[256];
    
    std::auto_ptr<SQLMsg> pMsg1(DBManager::instance().DirectQuery("SELECT ip FROM player.player WHERE account_id = '%d'", GetDesc()->GetAccountTable().id));
    MYSQL_ROW row = mysql_fetch_row(pMsg1->Get()->pSQLResult);
            
    if (pMsg1->uiSQLErrno != 0 || !pMsg1->Get()->uiNumRows)
        return;
    
    snprintf(szQuery, sizeof(szQuery), "INSERT INTO player.promo_code_restriction SET account_id = '%d', player_name = '%s', promo_code = '%s', ip = '%s'", GetDesc()->GetAccountTable().id, GetName(), promo_code, row[0]);
    std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(szQuery));
}
 
Son düzenleme:
Paylasım ıcın tesekkurler :)
 
i have a problem
ea240ad68f071ed767fb47ca6aca449b.png
 

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

Benzer konular

  • 5.00 yıldız(lar) 2 Değerlendirme
2 3
Cevaplar
14
Görüntüleme
934
  • 5.00 yıldız(lar) 1 Değerlendirme
3 4 5
Cevaplar
21
Görüntüleme
1K
Geri
Üst