Premium MrLibya 554 Posted December 22, 2014 Premium Share Posted December 22, 2014 (edited) M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hallo This Is For Block Item's In Map : Beeter Then Quest : char_item.cpp Serch : static bool IS_SUMMON_ITEM(int vnum) after it add : static bool IS_ENABLE_ITEM(int vnum) { switch (vnum) { case 39011: case 39012: case 39013: return true; } return false; } 39011,39012,39013 Item's Want To Block It Serch : bool IS_BOTARYABLE_ZONE(int nMapIndex) [code] Befor IT Add [code] bool IS_ENABLE_ITEM_ZONE(int map_index) { switch (map_index) { case 29: case 30: case 31: return false; } return true; } [/code] 29,30,31 Maps Index Serch : [code] //PREVENT_TRADE_WINDOW [/code] Befor It Add : [code] if (IS_ENABLE_ITEM(item->GetVnum())) { if (false == IS_ENABLE_ITEM_ZONE(GetMapIndex())) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ç؟ëاز¼ِ ¾ّ½ہ´د´ظ.")); return false; } } Note : This System By MrLibya , For www.Arab-Dev.Org , Ida Edited August 20, 2022 by Metin2 Dev Core X - External 2 Internal 17 1 1 4 16 If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
Premium Galet 510 Posted December 22, 2014 Premium Share Posted December 22, 2014 Thanks, I made a system for that but with a .txt modifiable in serverside. 1 Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted December 22, 2014 Share Posted December 22, 2014 (edited) Hallo This Is For Block Item's In Map : Beeter Then Quest : char_item.cpp Serch : static bool IS_SUMMON_ITEM(int vnum) after it add : static bool IS_ENABLE_ITEM(int vnum) { switch (vnum) { case 39011: case 39012: case 39013: return true; } return false; } 39011,39012,39013 Item's Want To Block It Serch : bool IS_BOTARYABLE_ZONE(int nMapIndex) [code] Befor IT Add [code] bool IS_ENABLE_ITEM_ZONE(int map_index) { switch (map_index) { case 29: case 30: case 31: return false; } return true; } [/code] 29,30,31 Maps Index Serch : [code] //PREVENT_TRADE_WINDOW [/code] Befor It Add : [code] if (IS_ENABLE_ITEM(item->GetVnum())) { if (false == IS_ENABLE_ITEM_ZONE(GetMapIndex())) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ç؟ëاز¼ِ ¾ّ½ہ´د´ظ.")); return false; } } Note : This System By MrLibya , For www.Arab-Dev.Org , Ida he want do it in a archive txt in the server not in the source, but is a nice idea Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal 1 https://m2admin.net/ Link to comment Share on other sites More sharing options...
Premium MrLibya 554 Posted December 22, 2014 Author Premium Share Posted December 22, 2014 Well You Can Do It By Txt Base On That 1 If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
Premium Galet 510 Posted December 22, 2014 Premium Share Posted December 22, 2014 I made a txt version by using : std::ifstream inf((LocaleService_GetBasePath() + "/block_vnum.txt").c_str()); And based on "arena.cpp" block list. ^^ 1 Link to comment Share on other sites More sharing options...
ѕeмa™ 308 Posted December 22, 2014 Share Posted December 22, 2014 I made a txt version by using : std::ifstream inf((LocaleService_GetBasePath() + "/block_vnum.txt").c_str()); And based on "arena.cpp" block list. ^^ but how u get the split(",") for the items on the map index? Sorry, i dont know c++ xd https://m2admin.net/ Link to comment Share on other sites More sharing options...
Krixius 13 Posted December 22, 2014 Share Posted December 22, 2014 First of all thnks mr.libya. i think about put a .txt for block the items in each map. Your option is good, but this requires a selfmaded version for do the changes in the vnums. I hope if anyone of you can do a .txt or a .lst for block the items, its more good. 1 Link to comment Share on other sites More sharing options...
Premium MrLibya 554 Posted December 22, 2014 Author Premium Share Posted December 22, 2014 Will I Am Don't Know Any Thing About C++ , But I Will Try To Make It By Txt When I Have Time If you're going to do something, then do it right. Link to comment Share on other sites More sharing options...
Berdinard 13 Posted December 22, 2014 Share Posted December 22, 2014 When i go to house i make a tutorial for. Txt in server for you. Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted December 23, 2014 Premium Share Posted December 23, 2014 Here it is with text file if someone still interested: item_block.cpp: #include "stdafx.h" #include "item_block.h" #include <fstream> #include <sstream> CItemBlock::CItemBlock(void) { } CItemBlock::~CItemBlock(void) { } void CItemBlock::Process(void) { std::string strMapIndex; std::string strItemVnums; std::ifstream File("blocked_items.txt"); if (!File.is_open()) return; if (!m_map_BlockedItems.empty()) m_map_BlockedItems.clear(); while (!File.eof()) { File >> strMapIndex >> strItemVnums; std::string strItemVnum; std::istringstream Vnums(strItemVnums); while (std::getline(Vnums, strItemVnum, ',')) { AddItem(strtoul(strMapIndex.c_str(), NULL, 10), strtoul(strItemVnum.c_str(), NULL, 10)); } } File.close(); } void CItemBlock::AddItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; m_map_BlockedItems.insert(std::make_pair(lMapIndex, dwVnum)); } void CItemBlock::RemoveItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end() { if (it->first == lMapIndex && it->second == dwVnum) it = m_map_BlockedItems.erase(it); else ++it; } } bool CItemBlock::CanUseItem(const long lMapIndex, const DWORD dwVnum) const { for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end() { if (it->first == lMapIndex && it->second == dwVnum) return false; } return true; } item_block.h: #ifndef __ITEM_BLOCK #define __ITEM_BLOCK class CItemBlock : public singleton<CItemBlock> { public: CItemBlock(); ~CItemBlock(); void Process(void); bool CanUseItem(const long lMapIndex, const DWORD dwVnum) const; void AddItem(const long lMapIndex, const DWORD dwVnum); void RemoveItem(const long lMapIndex, const DWORD dwVnum); private: typedef std::multimap<long, DWORD> BLOCKED_ITEMS; BLOCKED_ITEMS m_map_BlockedItems; }; #endif /* __ITEM_BLOCK */ - Item can be removed runtime by using the RemoveItem(map_index, item_vnum) function. - Item can be added runtime by using the AddItem(map_index, item_vnum) function - To load or reload the txt file use the Process() function Example of the TXT file: 50 120229,252391 51 10000,20000 52 43232 9 Link to comment Share on other sites More sharing options...
Night 366 Posted December 23, 2014 Share Posted December 23, 2014 Here it is with text file if someone still interested: item_block.cpp: #include "stdafx.h" #include "item_block.h" #include <fstream> #include <sstream> CItemBlock::CItemBlock(void) { } CItemBlock::~CItemBlock(void) { } void CItemBlock::Process(void) { std::string strMapIndex; std::string strItemVnums; std::ifstream File("blocked_items.txt"); if (!File.is_open()) return; if (!m_map_BlockedItems.empty()) m_map_BlockedItems.clear(); while (!File.eof()) { File >> strMapIndex >> strItemVnums; std::string strItemVnum; std::istringstream Vnums(strItemVnums); while (std::getline(Vnums, strItemVnum, ',')) { AddItem(strtoul(strMapIndex.c_str(), NULL, 10), strtoul(strItemVnum.c_str(), NULL, 10)); } } File.close(); } void CItemBlock::AddItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; m_map_BlockedItems.insert(std::make_pair(lMapIndex, dwVnum)); } void CItemBlock::RemoveItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end() { if (it->first == lMapIndex && it->second == dwVnum) it = m_map_BlockedItems.erase(it); else ++it; } } bool CItemBlock::CanUseItem(const long lMapIndex, const DWORD dwVnum) const { for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end() { if (it->first == lMapIndex && it->second == dwVnum) return false; } return true; } item_block.h: #ifndef __ITEM_BLOCK #define __ITEM_BLOCK class CItemBlock : public singleton<CItemBlock> { public: CItemBlock(); ~CItemBlock(); void Process(void); bool CanUseItem(const long lMapIndex, const DWORD dwVnum) const; void AddItem(const long lMapIndex, const DWORD dwVnum); void RemoveItem(const long lMapIndex, const DWORD dwVnum); private: typedef std::multimap<long, DWORD> BLOCKED_ITEMS; BLOCKED_ITEMS m_map_BlockedItems; }; #endif /* __ITEM_BLOCK */ - Item can be removed runtime by using the RemoveItem(map_index, item_vnum) function. - Item can be added runtime by using the AddItem(map_index, item_vnum) function - To load the txt file use the Process() function Example of the TXT file: 50 120229,252391 51 10000,20000 52 43232 i like how you make a new cpp + header for easy remove when you need to Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted December 23, 2014 Premium Share Posted December 23, 2014 Much cleaner then adding all of this to an already existing file. Link to comment Share on other sites More sharing options...
Shichirojii 8 Posted January 20, 2015 Share Posted January 20, 2015 (edited) I have this error in my source. any solution? Edited August 18, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Nygal034 0 Posted February 9, 2015 Share Posted February 9, 2015 (edited) Here it is with text file if someone still interested: item_block.cpp: #include "stdafx.h" #include "item_block.h" #include <fstream> #include <sstream> CItemBlock::CItemBlock(void) { } CItemBlock::~CItemBlock(void) { } void CItemBlock::Process(void) { std::string strMapIndex; std::string strItemVnums; std::ifstream File("blocked_items.txt"); if (!File.is_open()) return; if (!m_map_BlockedItems.empty()) m_map_BlockedItems.clear(); while (!File.eof()) { File >> strMapIndex >> strItemVnums; std::string strItemVnum; std::istringstream Vnums(strItemVnums); while (std::getline(Vnums, strItemVnum, ',')) { AddItem(strtoul(strMapIndex.c_str(), NULL, 10), strtoul(strItemVnum.c_str(), NULL, 10)); } } File.close(); } void CItemBlock::AddItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; m_map_BlockedItems.insert(std::make_pair(lMapIndex, dwVnum)); } void CItemBlock::RemoveItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end() { if (it->first == lMapIndex && it->second == dwVnum) it = m_map_BlockedItems.erase(it); else ++it; } } bool CItemBlock::CanUseItem(const long lMapIndex, const DWORD dwVnum) const { for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end() { if (it->first == lMapIndex && it->second == dwVnum) return false; } return true; } item_block.h: #ifndef __ITEM_BLOCK #define __ITEM_BLOCK class CItemBlock : public singleton<CItemBlock> { public: CItemBlock(); ~CItemBlock(); void Process(void); bool CanUseItem(const long lMapIndex, const DWORD dwVnum) const; void AddItem(const long lMapIndex, const DWORD dwVnum); void RemoveItem(const long lMapIndex, const DWORD dwVnum); private: typedef std::multimap<long, DWORD> BLOCKED_ITEMS; BLOCKED_ITEMS m_map_BlockedItems; }; #endif /* __ITEM_BLOCK */ - Item can be removed runtime by using the RemoveItem(map_index, item_vnum) function. - Item can be added runtime by using the AddItem(map_index, item_vnum) function - To load or reload the txt file use the Process() function Example of the TXT file: 50 120229,252391 51 10000,20000 52 43232 For me is not working.. it crash. The issue is this: https://metin2.download/picture/cKZ0I9ew34bxF3eyABl64lN4vMiTuq23/.png. I think because there is not a constructor (i have tried without singleton and it is work but I need singleton..) that initialize the multimap, but I think also I am doing something that is not right. I am using g++4.2.1 (default). Edited August 30, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Sanchez 2467 Posted February 22, 2015 Premium Share Posted February 22, 2015 It's using singleton, so you have to create at least one instance of the class at the startup: CItemBlock c; And then you can process it: CItemBlock::Instance().Process(); 1 Link to comment Share on other sites More sharing options...
testtest 1 Posted March 26, 2015 Share Posted March 26, 2015 (edited) Duello event Hallo This Is For Block Item's In Map : Beeter Then Quest : char_item.cpp Serch : static bool IS_SUMMON_ITEM(int vnum) after it add : static bool IS_ENABLE_ITEM(int vnum) { switch (vnum) { case 39011: case 39012: case 39013: return true; } return false; } 39011,39012,39013 Item's Want To Block It Serch : bool IS_BOTARYABLE_ZONE(int nMapIndex) [code] Befor IT Add [code] bool IS_ENABLE_ITEM_ZONE(int map_index) { switch (map_index) { case 29: case 30: case 31: return false; } return true; } [/code] 29,30,31 Maps Index Serch : [code] //PREVENT_TRADE_WINDOW [/code] Befor It Add : [code] if (IS_ENABLE_ITEM(item->GetVnum())) { if (false == IS_ENABLE_ITEM_ZONE(GetMapIndex())) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ç؟ëاز¼ِ ¾ّ½ہ´د´ظ.")); return false; } } Note : This System By MrLibya , For www.Arab-Dev.Org , Ida he want do it in a archive txt in the server not in the source, but is a nice idea How do we close the duel activity in blessing others shamans character feature? So locking ability . Edited August 19, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Salya 1 Posted April 20, 2015 Premium Share Posted April 20, 2015 Hi, I've try your files with txt but when I compile " item_block.cpp" and "item_block.h" don't appear in the files'log. Link to comment Share on other sites More sharing options...
Premium EnKor 42 Posted December 10, 2016 Premium Share Posted December 10, 2016 (edited) On 23/12/2014 at 1:15 AM, Sanchez said: Here it is with text file if someone still interested: item_block.cpp: #include "stdafx.h" #include "item_block.h" #include <fstream> #include <sstream> CItemBlock::CItemBlock(void) { } CItemBlock::~CItemBlock(void) { } void CItemBlock::Process(void) { std::string strMapIndex; std::string strItemVnums; std::ifstream File("blocked_items.txt"); if (!File.is_open()) return; if (!m_map_BlockedItems.empty()) m_map_BlockedItems.clear(); while (!File.eof()) { File >> strMapIndex >> strItemVnums; std::string strItemVnum; std::istringstream Vnums(strItemVnums); while (std::getline(Vnums, strItemVnum, ',')) { AddItem(strtoul(strMapIndex.c_str(), NULL, 10), strtoul(strItemVnum.c_str(), NULL, 10)); } } File.close(); } void CItemBlock::AddItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; m_map_BlockedItems.insert(std::make_pair(lMapIndex, dwVnum)); } void CItemBlock::RemoveItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end() { if (it->first == lMapIndex && it->second == dwVnum) it = m_map_BlockedItems.erase(it); else ++it; } } bool CItemBlock::CanUseItem(const long lMapIndex, const DWORD dwVnum) const { for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end() { if (it->first == lMapIndex && it->second == dwVnum) return false; } return true; } item_block.h: #ifndef __ITEM_BLOCK #define __ITEM_BLOCK class CItemBlock : public singleton<CItemBlock> { public: CItemBlock(); ~CItemBlock(); void Process(void); bool CanUseItem(const long lMapIndex, const DWORD dwVnum) const; void AddItem(const long lMapIndex, const DWORD dwVnum); void RemoveItem(const long lMapIndex, const DWORD dwVnum); private: typedef std::multimap<long, DWORD> BLOCKED_ITEMS; BLOCKED_ITEMS m_map_BlockedItems; }; #endif /* __ITEM_BLOCK */ - Item can be removed runtime by using the RemoveItem(map_index, item_vnum) function. - Item can be added runtime by using the AddItem(map_index, item_vnum) function - To load or reload the txt file use the Process() function Example of the TXT file: 50 120229,252391 51 10000,20000 52 43232 any help? https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif Edited September 3, 2022 by Metin2 Dev Core X - External 2 Internal if pc.get_sex() == true and npc.get_sex() == false then npc.purge() end Link to comment Share on other sites More sharing options...
metin2-factory 1010 Posted December 11, 2016 Share Posted December 11, 2016 item_block.cpp line 70 modify to the following: for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end();++it) 1 Link to comment Share on other sites More sharing options...
Premium EnKor 42 Posted December 11, 2016 Premium Share Posted December 11, 2016 On 11/12/2016 at 0:06 AM, metin2-factory said: item_block.cpp line 70 modify to the following: for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end();++it) i get same error in line 59. So i make the same u say.... This systems it's all bug :\ Cant compile. But ty anywat error: " item_block.cpp:61: error: no matching function for call to 'std::multimap<long int, unsigned int, " if pc.get_sex() == true and npc.get_sex() == false then npc.purge() end Link to comment Share on other sites More sharing options...
127.0.0.1 34 Posted December 11, 2016 Share Posted December 11, 2016 40 minutes ago, EnKor said: i get same error in line 59. So i make the same u say.... This systems it's all bug :\ Cant compile. But ty anywat error: " item_block.cpp:61: error: no matching function for call to 'std::multimap<long int, unsigned int, " Here if fixed : #include "stdafx.h" #include "item_block.h" #include <fstream> #include <sstream> void CItemBlock::Process() { std::string strMapIndex; std::string strItemVnums; std::ifstream File("blocked_items.txt"); if (!File.is_open()) return; if (!m_map_BlockedItems.empty()) m_map_BlockedItems.clear(); while (!File.eof()) { File >> strMapIndex >> strItemVnums; std::string strItemVnum; std::istringstream Vnums(strItemVnums); while (std::getline(Vnums, strItemVnum, ',')) { AddItem(strtoul(strMapIndex.c_str(), NULL, 10), strtoul(strItemVnum.c_str(), NULL, 10)); } } File.close(); } void CItemBlock::AddItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; m_map_BlockedItems.insert(std::make_pair(lMapIndex, dwVnum)); } void CItemBlock::RemoveItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); if (it != m_map_BlockedItems.end()) { if (it->first == lMapIndex && it->second == dwVnum) it = m_map_BlockedItems.erase(it); else ++it; } } bool CItemBlock::CanUseItem(const long lMapIndex, const DWORD dwVnum) const { BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); if (it != m_map_BlockedItems.end()) { if (it->first == lMapIndex && it->second == dwVnum) return false; } return true; } #pragma once class CItemBlock : public singleton<CItemBlock> { public: CItemBlock() { } ~CItemBlock() { } void Process(); bool CanUseItem(const long lMapIndex, const DWORD dwVnum) const; void AddItem(const long lMapIndex, const DWORD dwVnum); void RemoveItem(const long lMapIndex, const DWORD dwVnum); private: typedef std::multimap<long, DWORD> BLOCKED_ITEMS; BLOCKED_ITEMS m_map_BlockedItems; }; 1 Link to comment Share on other sites More sharing options...
Premium EnKor 42 Posted December 11, 2016 Premium Share Posted December 11, 2016 (edited) On 11/12/2016 at 9:47 AM, 127.0.0.1 said: Here if fixed : #include "stdafx.h" #include "item_block.h" #include <fstream> #include <sstream> void CItemBlock::Process() { std::string strMapIndex; std::string strItemVnums; std::ifstream File("blocked_items.txt"); if (!File.is_open()) return; if (!m_map_BlockedItems.empty()) m_map_BlockedItems.clear(); while (!File.eof()) { File >> strMapIndex >> strItemVnums; std::string strItemVnum; std::istringstream Vnums(strItemVnums); while (std::getline(Vnums, strItemVnum, ',')) { AddItem(strtoul(strMapIndex.c_str(), NULL, 10), strtoul(strItemVnum.c_str(), NULL, 10)); } } File.close(); } void CItemBlock::AddItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; m_map_BlockedItems.insert(std::make_pair(lMapIndex, dwVnum)); } void CItemBlock::RemoveItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); if (it != m_map_BlockedItems.end()) { if (it->first == lMapIndex && it->second == dwVnum) it = m_map_BlockedItems.erase(it); else ++it; } } bool CItemBlock::CanUseItem(const long lMapIndex, const DWORD dwVnum) const { BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); if (it != m_map_BlockedItems.end()) { if (it->first == lMapIndex && it->second == dwVnum) return false; } return true; } #pragma once class CItemBlock : public singleton<CItemBlock> { public: CItemBlock() { } ~CItemBlock() { } void Process(); bool CanUseItem(const long lMapIndex, const DWORD dwVnum) const; void AddItem(const long lMapIndex, const DWORD dwVnum); void RemoveItem(const long lMapIndex, const DWORD dwVnum); private: typedef std::multimap<long, DWORD> BLOCKED_ITEMS; BLOCKED_ITEMS m_map_BlockedItems; }; Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal if pc.get_sex() == true and npc.get_sex() == false then npc.purge() end Link to comment Share on other sites More sharing options...
metin2-factory 1010 Posted December 11, 2016 Share Posted December 11, 2016 in block_item.cpp modify these 2 functions Spoiler void CItemBlock::RemoveItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end();++it) { if (it->first == lMapIndex && it->second == dwVnum) m_map_BlockedItems.erase(it); } } bool CItemBlock::CanUseItem(const long lMapIndex, const DWORD dwVnum) const { for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end();++it) { if (it->first == lMapIndex && it->second == dwVnum) return false; } return true; } 1 Link to comment Share on other sites More sharing options...
Premium EnKor 42 Posted December 11, 2016 Premium Share Posted December 11, 2016 (edited) On 11/12/2016 at 10:10 AM, metin2-factory said: in block_item.cpp modify these 2 functions Hide contents void CItemBlock::RemoveItem(const long lMapIndex, const DWORD dwVnum) { if (lMapIndex < 0 || dwVnum < 0) return; for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end();++it) { if (it->first == lMapIndex && it->second == dwVnum) m_map_BlockedItems.erase(it); } } bool CItemBlock::CanUseItem(const long lMapIndex, const DWORD dwVnum) const { for (BLOCKED_ITEMS::const_iterator it = m_map_BlockedItems.begin(); it != m_map_BlockedItems.end();++it) { if (it->first == lMapIndex && it->second == dwVnum) return false; } return true; } i belive this system wont work at all. Tks for ur help, but i belive its better give up. This system wont work at all. Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal if pc.get_sex() == true and npc.get_sex() == false then npc.purge() end Link to comment Share on other sites More sharing options...
127.0.0.1 34 Posted December 11, 2016 Share Posted December 11, 2016 (edited) @EnKor DUDE USE YOU BRAIN. Use my codes, as you can see it compiles. Edited August 24, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
Recommended Posts