xEvo7 65 Report post Posted April 16, 2017 Hi Guys, just wondering. How can i restrict a fused equipment to a map? I know how to restrict an item but when its fused. They can enter with the item.. Quote Hit Like If You Like It! Share this post Link to post Share on other sites
Angelix 374 Report post Posted April 16, 2017 You're going to use the same method you say you have, but instead of checking for "GetItemID", you're going to check for "GetItemAttr(Item, ITEMATTR_VAL_FUSIONID)". 3 Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted April 16, 2017 @xEvo7 take a look on glacierpk map ( roso files ) 1 Quote Share this post Link to post Share on other sites
xEvo7 65 Report post Posted April 16, 2017 12 hours ago, Angelix said: You're going to use the same method you say you have, but instead of checking for "GetItemID", you're going to check for "GetItemAttr(Item, ITEMATTR_VAL_FUSIONID)". 6 hours ago, Rinor said: @xEvo7 take a look on glacierpk map ( roso files ) thank you both, gave me the idea. Quote Hit Like If You Like It! Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted April 17, 2017 Hello @xEvo7! functions.lua function CheckItemIsForged(item) return (GetItemForgeParam(item, 0) > 0) end function NoForge(role) -- Checking Look for i = 0, enumEQUIP_RHAND + 1, 1 do local item = GetChaItem(role, 1, i) if (item ~= 0 and item ~= nil) then if (CheckItemIsForged(item) == 1) then return 0 end end end -- Checking Inventory local kbsize = GetKbCap(role) for i = 0, kbsize - 1, 1 do local item = GetChaItem(role, 2, i) if (item ~= 0 and item ~= nil) then if (CheckItemIsForged(item) == 1) then return 0 end end end return 1 end entry.lua function check_can_enter_mapname(role, copy_mgr) if (NoForge(role) == 0) then SystemNotice(role, "You have forged items! You can't enter the map!") return 0 end return 1 end Note: didn't tested 1 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
xEvo7 65 Report post Posted April 17, 2017 (edited) @V3ct0r will try to check and update you, thanks! Edited April 17, 2017 by xEvo7 Quote Hit Like If You Like It! Share this post Link to post Share on other sites
Fajar 1 Report post Posted April 18, 2017 got eror when i use if (NoForge(role) == 0) then SystemNotice(role, "You have fused items! You can't enter the map!") return 0 end return 1 end eror: Quote Share this post Link to post Share on other sites
xEvo7 65 Report post Posted April 18, 2017 @Fajar which function did you put it to? Quote Hit Like If You Like It! Share this post Link to post Share on other sites
Fajar 1 Report post Posted April 18, 2017 @xEvo7 yes Quote Share this post Link to post Share on other sites
Angelix 374 Report post Posted April 18, 2017 38 minutes ago, Fajar said: @xEvo7 yes Yes what? He asked for the function you put it into to, not a "yes or no" question. If you want help, you're going to need to be more specific. Quote Share this post Link to post Share on other sites
Fajar 1 Report post Posted April 18, 2017 56 minutes ago, Angelix said: Yes what? He asked for the function you put it into to, not a "yes or no" question. If you want help, you're going to need to be more specific. Sorry im bad in english. i put function CheckItemIsForged(item) return (GetItemForgeParam(item, 0) > 0) end function NoForge(role) -- Checking Look for i = 0, enumEQUIP_RHAND + 1, 1 do local item = GetChaItem(role, 1, i) if (item ~= 0 and item ~= nil) then if (CheckItemIsForged(item) == 1) then return 0 end end end -- Checking Inventory local kbsize = GetKbCap(role) for i = 0, kbsize - 1, 1 do local item = GetChaItem(role, 2, i) if (item ~= 0 and item ~= nil) then if (CheckItemIsForged(item) == 1) then return 0 end end end return 1 end at the end function.lua. And i put function check_can_enter_glacierpk(role, copy_mgr) if (NoForge(role) == 0) then SystemNotice(role, "You have forged items! You can't enter the map!") return 0 end return 1 end in entry.lua Quote Share this post Link to post Share on other sites
DangThao 81 Report post Posted April 18, 2017 7 hours ago, Fajar said: function check_can_enter_glacierpk(role, copy_mgr) if (NoForge(role) == 0) then SystemNotice(role, "You have forged items! You can't enter the map!") return 0 end return 1 end in entry.lua I think it should be like: function check_can_enter_glacierpk(role, copy_mgr) if (NoForge(role) == 0) then SystemNotice(role, "You have forged items! You can't enter the map!") return 0 else return 1 end end Quote Share this post Link to post Share on other sites
Fajar 1 Report post Posted April 19, 2017 7 hours ago, DangThao said: I think it should be like: function check_can_enter_glacierpk(role, copy_mgr) if (NoForge(role) == 0) then SystemNotice(role, "You have forged items! You can't enter the map!") return 0 else return 1 end end I've tried it, and get the same error Quote Share this post Link to post Share on other sites
iZae 55 Report post Posted April 19, 2017 I think the problem is not the function itself, it may be that you deleted an end of another function. Paste here the full entry.lua you've modified. 1 Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted April 19, 2017 В 18.04.2017 в 20:02, DangThao сказал: I think it should be like: function check_can_enter_glacierpk(role, copy_mgr) if (NoForge(role) == 0) then SystemNotice(role, "You have forged items! You can't enter the map!") return 0 else return 1 end end This is the same script. It does not matter whether 'return 1' is inside inside the if-else statement or not. 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