Hello!
i Have this code for change GoldBars
but i can't fix it:(
i have makes Vouchers but this......
what is wrong here????
Code: char.cpp
- #ifdef __GOLD_BARS__
- bool CHARACTER::ChangeGoldBars(DWORD dwVnum)
- {
- int dlCount = 0;
- for(int i = 0; i < GOLD_BARS_NUM; i++)
- {
- if(GoldBarsItems[i] == dwVnum)
- {
- dlCount = GoldBarsValue[i];
- break;
- }
- }
- if(dlCount == 0)
- {
- return false;
- }
- SetGold(GetGold() + dlCount);
- TItemTable* pItemTable = ITEM_MANAGER::instance().GetTable(dwVnum);
- if(pItemTable)
- ChatPacket(CHAT_TYPE_INFO , "<SYSTEM> Ai primit [%d] yang!", dlCount);
- LogManager::instance().GoldBarsLog(GetAID() , GetPlayerID() , dwVnum , dlCount);
- }
- #endif
SQL
- ']/*
- Navicat MySQL Data Transfer
- Source Server : adc
- Source Server Version : 50533
- Source Host : 192.168.1.254:3306
- Source Database : log
- Target Server Type : MYSQL
- Target Server Version : 50533
- File Encoding : 65001
- Date: 2018-02-25 18:58:52
- */
- SET FOREIGN_KEY_CHECKS=0;
- -- ----------------------------
- -- Table structure for voucher_yang_log
- -- ----------------------------
- DROP TABLE IF EXISTS `voucher_yang_log`;
- CREATE TABLE `voucher_yang_log` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `player_id` int(10) unsigned NOT NULL,
- `account_id` int(10) unsigned NOT NULL,
- `item_vnum` int(10) unsigned NOT NULL,
- `valoare_yang` int(10) unsigned NOT NULL,
- `data` datetime NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
Code: log.cpp
in char.h Under "public:"
Code: char_item.cpp
- #ifdef __GOLD_BARS__
- switch (item->GetVnum())
- {
- case 80003: // 50kk
- case 80004: // 100kk
- case 80005: // 250kk
- case 80006: // 500kk
- case 80007: // 1kkk
- if (ChangeGoldBars(item->GetVnum()))
- {
- item->SetCount(item->GetCount() - 1);
- }
- else
- {
- ChatPacket(CHAT_TYPE_INFO, "[LINGOU] A aparut o eroare. Contactati administratorul.");
- }
- return 1;
- break;
- default:
- break;
- }
- #endif