gunnapong 14 Report post Posted September 19, 2022 hello, i want to Weapons or outfits with a time limit of 7 days. If after 7 days the item will disappear or become unusable, I would like to know how we should code it. Quote Share this post Link to post Share on other sites
V3ct0r 2,116 Report post Posted September 24, 2022 Hello @gunnapong, Sample Algorithm: 1) Add a characteristic to the item with an ID <ID> that will record the time that the item has been in the player's bag in the function Creat_Item() (check this topic); 2) In the cha_timer() function: 2.1) Search for the items with ID <ID> (GetChaItem()); 2.2) Read the time characteristic from the item (GetItemAttr()); 2.3) Check that characteristic is equal to value 604800. Remove the item if this is true; 2.4) Otherwise increment the characteristic by 1 and update the item (SetItemAttr()). 2.5) Repeat 2.1 - 2.4 for all items with ID <ID> in the player's bag. 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
gunnapong 14 Report post Posted September 25, 2022 14 hours ago, V3ct0r said: Hello @gunnapong, Sample Algorithm: 1) Add a characteristic to the item with an ID <ID> that will record the time that the item has been in the player's bag in the function Creat_Item() (check this topic); 2) In the cha_timer() function: 2.1) Search for the items with ID <ID> (GetChaItem()); 2.2) Read the time characteristic from the item (GetItemAttr()); 2.3) Check that characteristic is equal to value 604800. Remove the item if this is true; 2.4) Otherwise increment the characteristic by 1 and update the item (SetItemAttr()). 2.5) Repeat 2.1 - 2.4 for all items with ID <ID> in the player's bag. Thanks for answering me, I would like you to try writing some working code for me. @V3ct0r Quote Share this post Link to post Share on other sites
V3ct0r 2,116 Report post Posted October 25, 2022 On 9/25/2022 at 5:52 AM, gunnapong said: Thanks for answering me, I would like you to try writing some working code for me. @V3ct0r Maybe someday I will develop such a mod. 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