ADELIJAH 1 Report post Posted November 11, 2023 Does anyone have the code that counts the number of players inside the maze? I know there's one on the forum, but over time it gives the bug "FUCNCTION. LUA STACK OVERFLOW in the code lines" the V3ctor one that is only used in the after enter functions and before_leave seems promising because it only works when someone enters or leaves, unlike map_copy_run which updates all the time, but it doesn't work resource/abandonedcity\ctrl.lua:48: )' expected near º' SetPortalName("<darkswamp>", string.format("%d player(s) inside", GetMapActivePlayer(GetChaMapCopу(role)) - 1)) Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted November 13, 2023 Hello @ADELIJAH, 1) Count players in after_enter_<map>() and before_leave_<map>() functions; 2) Use the GetMapActivePlayer() function (garner2 map); 3) Use the DealAllActivePlayerInMap() function and write a custom script for the function to count players. Try this script for resource\abandonedcity\ctrl.lua: function after_enter_abandonedcity(role, map_copy) SetPortalName("<darkswamp>", GetMapActivePlayer(map_copy) + 1 .. " player(s) inside") end function before_leave_abandonedcity(role) SetPortalName("<darkswamp>", GetMapActivePlayer(GetChaMapCopу(role)) - 1 .. " player(s) inside") end 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