Fajar 1 Report post Posted March 26, 2017 Hello. Can Someone help me? How to check item in inventory before entering map? Thanks who can help me Quote Share this post Link to post Share on other sites
DangThao 81 Report post Posted March 26, 2017 Root>resource>mapname>entry.lua Use/change the below code to your own. function check_can_enter_darkswamp( role, copy_mgr ) local Num_1= CheckBagItem(role,0222) if Num_1 >= 1 then SystemNotice(role, "Please, remove [Snow Dragon Fruit] from your inventory!") return 0 end local Num_2= CheckBagItem(role,0223) if Num_2 >= 1 then SystemNotice(role, "Please, remove [Icespire Plum] from your inventory!") return 0 end end This will check player for items, if they got the item then they can't enter. If u dont want them to drop and enter while teleporting delay(if you got) then make sure, u make the item undroppable, meaning they will have to delete it to enter. 1 Quote Share this post Link to post Share on other sites
Fajar 1 Report post Posted March 26, 2017 @DangThao Thanks. Quote Share this post Link to post Share on other sites
V3ct0r 2,121 Report post Posted March 29, 2017 Hello @Fajar! As @DangThao mentioned, there is function CheckBagItem(role, ItemID) which returns number of items with ID ItemID in role's inventory. You can use it in function check_can_enter_<mapname>(role, copymgr) which is located in server\resource\mapname\entry.lua 2 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Fajar 1 Report post Posted March 29, 2017 @V3ct0r Thanks Quote Share this post Link to post Share on other sites