ahmad 3 Report post Posted August 22, 2018 Helo pko! can someone share how can limit players enter to x map per mac like allow 2 character per mac i'm using LuaSQL Quote Share this post Link to post Share on other sites
V3ct0r 2,143 Report post Posted August 26, 2018 Hello, @ahmad! You can try make the limit in a function after_enter_<mapname>(role), file ctrl.lua of required map. 1) Get MAC of role using LuaSQL; 2) Check that the MAC was used no more than X times (N <= X); 3) if the limit is exceeded, then kick the character from the map; 4) else increment N - number of MAC uses. Also you will need decrease N in function before_leave_<mapname>(role), when role leaves the map. Another way: 1) Execute the following SQL query using LuaSQL (example): SELECT l.last_login_mac, COUNT (c.cha_id) AS n FROM GameDB.dbo.character AS c LEFT JOIN GameDB.dbo.account AS a ON (a.act_id = c.act_id) LEFT JOIN AccountServer.dbo.account_login AS l ON (l.name = a.act_name COLLATE Cyrillic_General_CI_AS) WHERE c.mem_addr = 0 AND c.map = 'garner' GROUP BY l.last_login_mac It will return the number of each MAC (N) used in the map. 2) Get MAC of role using LuaSQL; 3) Find role's MAC in the query result and get N; 4) Check that the MAC was used no more than X times (N <= X); 5) ... 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
ahmad 3 Report post Posted August 26, 2018 4 hours ago, V3ct0r said: Hello, @ahmad! You can try make the limit in a function after_enter_<mapname>(role), file ctrl.lua of required map. 1) Get MAC of role using LuaSQL; 2) Check that the MAC was used no more than X times (N <= X); 3) if the limit is exceeded, then kick the character from the map; 4) else increment N - number of MAC uses. Also you will need decrease N in function before_leave_<mapname>(role), when role leaves the map. Another way: 1) Execute the following SQL query using LuaSQL (example): SELECT l.last_login_mac, COUNT (c.cha_id) AS n FROM GameDB.dbo.character AS c LEFT JOIN GameDB.dbo.account AS a ON (a.act_id = c.act_id) LEFT JOIN AccountServer.dbo.account_login AS l ON (l.name = a.act_name COLLATE Cyrillic_General_CI_AS) WHERE c.mem_addr = 0 AND c.map = 'garner' GROUP BY l.last_login_mac It will return the number of each MAC (N) used in the map. 2) Get MAC of role using LuaSQL; 3) Find role's MAC in the query result and get N; 4) Check that the MAC was used no more than X times (N <= X); 5) ... can you please explain how the function could be? i'm using this to get the players mac function GetAccountMAC(Player) local AccountName = GetActName(Player) local String = "SELECT last_login_mac FROM AccountServer.dbo.account_login WHERE name = '"..AccountName.."'" local Connect, CID = LuaSQL("connect", SQL.AccountServer.Host, SQL.AccountServer.User, SQL.AccountServer.Password) if Connect == SQL_SUCCESS_WITH_INFO then local Success, Query = LuaSQL("query", CID, String) if Success == SQL_SUCCESS_WITH_INFO then local Data = LuaSQL("fetch", CID, Query) LuaSQL("freehandle", CID, Query) LuaSQL("close", CID) return Data["last_login_mac"] end end end can use your query like this or how? function GetAccountMACn(Player) local AccountName = GetActName(Player) local String = "SELECT l.last_login_mac, COUNT (c.cha_id) AS n FROM GameDB.dbo.character AS c LEFT JOIN GameDB.dbo.account AS a ON (a.act_id = c.act_id) LEFT JOIN AccountServer.dbo.account_login AS l ON (l.name = a.act_name COLLATE Cyrillic_General_CI_AS) WHERE c.mem_addr = 0 AND c.map = 'garner' GROUP BY l.last_login_mac" local Connect, CID = LuaSQL("connect", SQL.AccountServer.Host, SQL.AccountServer.User, SQL.AccountServer.Password, SQL.GameDB.Host, SQL.GameDB.User, SQL.GameDB.Password) if Connect == SQL_SUCCESS_WITH_INFO then local Success, Query = LuaSQL("query", CID, String) if Success == SQL_SUCCESS_WITH_INFO then local Data = LuaSQL("fetch", CID, Query) LuaSQL("freehandle", CID, Query) LuaSQL("close", CID) return Data["l.last_login_mac"] end end end Quote Share this post Link to post Share on other sites
ahmad 3 Report post Posted January 23, 2019 up Quote Share this post Link to post Share on other sites
Angelix 381 Report post Posted February 25, 2019 (edited) Using this function: function GetAccountMAC(Player) local AccountName = GetActName(Player) local String = "SELECT last_login_mac FROM AccountServer.dbo.account_login WHERE name = '"..AccountName.."'" local Connect, CID = LuaSQL("connect", SQL.AccountServer.Host, SQL.AccountServer.User, SQL.AccountServer.Password) if Connect == SQL_SUCCESS_WITH_INFO then local Success, Query = LuaSQL("query", CID, String) if Success == SQL_SUCCESS_WITH_INFO then local Data = LuaSQL("fetch", CID, Query) LuaSQL("freehandle", CID, Query) LuaSQL("close", CID) return Data["last_login_mac"] end end end Do this (using Chaos Argent as an example): ChaosArgentMAC = ChaosArgentMAC or {} function check_can_enter_garner2(Player, CopyMGR) ... local PlayerMac = GetAccountMAC(Player) ChaosArgentMAC[PlayerMac] = ChaosArgentMAC[PlayerMac] or false if ChaosArgentMAC[PlayerMac] then return 0 end end function after_enter_garner2(Player, MapCopy) ... local PlayerMac = GetAccountMAC(Player) ChaosArgentMAC[PlayerMac] = true end function before_leave_garner2(Player) ... local PlayerMac = GetAccountMAC(Player) ChaosArgentMAC[PlayerMac] = false end function map_copy_close_garner2(MapCopy) ... ChaosArgentMAC = {} end Give that a try and let me know. Although it relies heavily on loading LuaSQL constantly when trying to enter, entering and leaving so I don't know what effects it may have on server stability when having a high player base. Also just in case, reset the variable after map closing so it's persistent. Also, I don't know if the variable will be stored correctly, maybe you can convert it to a string so it stores without a problem? Don't know. Try the above, if any issues then convert the MAC address using "tostring" function on each "GetAccountMAC" call. Edited February 25, 2019 by Angelix 1 Quote Share this post Link to post Share on other sites
mkhzaleh 136 Report post Posted February 25, 2019 (edited) 7 hours ago, Angelix said: Using this function: function GetAccountMAC(Player) local AccountName = GetActName(Player) local String = "SELECT last_login_mac FROM AccountServer.dbo.account_login WHERE name = '"..AccountName.."'" local Connect, CID = LuaSQL("connect", SQL.AccountServer.Host, SQL.AccountServer.User, SQL.AccountServer.Password) if Connect == SQL_SUCCESS_WITH_INFO then local Success, Query = LuaSQL("query", CID, String) if Success == SQL_SUCCESS_WITH_INFO then local Data = LuaSQL("fetch", CID, Query) LuaSQL("freehandle", CID, Query) LuaSQL("close", CID) return Data["last_login_mac"] end end end Do this (using Chaos Argent as an example): ChaosArgentMAC = ChaosArgentMAC or {} function check_can_enter_garner2(Player, CopyMGR) ... local PlayerMac = GetAccountMAC(Player) ChaosArgentMAC[PlayerMac] = ChaosArgentMAC[PlayerMac] or false if ChaosArgentMAC[PlayerMac] then return 0 end end function after_enter_garner2(Player, MapCopy) ... local PlayerMac = GetAccountMAC(Player) ChaosArgentMAC[PlayerMac] = true end function before_leave_garner2(Player) ... local PlayerMac = GetAccountMAC(Player) ChaosArgentMAC[PlayerMac] = false end function map_copy_close_garner2(MapCopy) ... ChaosArgentMAC = {} end Give that a try and let me know. Although it relies heavily on loading LuaSQL constantly when trying to enter, entering and leaving so I don't know what effects it may have on server stability when having a high player base. Also just in case, reset the variable after map closing so it's persistent. Also, I don't know if the variable will be stored correctly, maybe you can convert it to a string so it stores without a problem? Don't know. Try the above, if any issues then convert the MAC address using "tostring" function on each "GetAccountMAC" call. he can use this way too , but its may be heavily loading idk function UPOGCin(Player)--player enter local pKey = "pKey" local File = GetResPath("../PlayerData/GoddessCollisio/"..pKey..".db") local macplayer = GetAccountMAC(Player) if UPOGCmap == nil then if file_exists(File) == false then UPOGCmap = {} table.save(UPOGCmap, File) else UPOGCmap = table.load(File) end end if UPOGCmap[macplayer] == nil then UPOGCmap[macplayer] = {Limit = 0} table.save(UPOGCmap, File) end if UPOGCmap[macplayer].Limit > 2 then UPOGCmap[macplayer].Limit = 2 end UPOGCmap[macplayer].Limit = UPOGCmap[macplayer].Limit + 1 table.save(UPOGCmap, File) end function UPOGCout(Player)--player leave local pKey = "pKey" local File = GetResPath("../PlayerData/GoddessCollisio/"..pKey..".db") local macplayer = GetAccountMAC(Player) if UPOGCmap == nil then if file_exists(File) == false then UPOGCmap = {} table.save(UPOGCmap, File) else UPOGCmap = table.load(File) end end if UPOGCmap[macplayer] == nil then UPOGCmap[macplayer] = {Limit = 0} table.save(UPOGCmap, File) end if UPOGCmap[macplayer].Limit < 0 then UPOGCmap[macplayer].Limit = 0 end UPOGCmap[macplayer].Limit = UPOGCmap[macplayer].Limit - 1 table.save(UPOGCmap, File) end function after_enter_UPOGC(role, map_copy) UPOGCin(role) end before_leave_UPOGC(role) UPOGCout(role) end function check_can_enter_UPOGC(role, copy_mgr) local UPOGC_charlimits = 2 -- mean player can join with 2 characters only -- local pKey = "pKey" local File = GetResPath("../PlayerData/GoddessCollisio/"..pKey..".db") local macplayer = GetAccountMAC(role) if UPOGCmap == nil then if file_exists(File) == false then UPOGCmap = {} table.save(UPOGCmap, File) else UPOGCmap = table.load(File) end end if UPOGCmap[macplayer] == nil then UPOGCmap[macplayer] = {Limit = 0} table.save(UPOGCmap, File) end if UPOGCmap[macplayer].Limit >= UPOGC_charlimits then BickerNotice(role,"You have 2 characters Inside") return 0 end end this one works fine , Edited February 25, 2019 by mkhzaleh 1 Quote Share this post Link to post Share on other sites
Angelix 381 Report post Posted February 25, 2019 Well of course it can work. The issue still persist and you amplified it though. On a server, opening and closing too many files at once will hang the server, and that’s what serialization does. It should work with the code I provided, maybe adjust a bit to allow more than one address per map so no use of aerialization. No no issues should arise on a low population server, the problem starts when a high population server uses a heavily triggered function that uses serialization (don’t know if it gets caused on LuaSQL). The GameServer will constantly open and close text files (generated by serialization) when called by the function and it will cause lag (hang by causing functions long execution times). Also, too much code and mine is less lines. Hahah 1 Quote Share this post Link to post Share on other sites
mkhzaleh 136 Report post Posted February 25, 2019 well yea it's , not sure if "LuaSQL" will hang the gs , but yea still can edit it to not use serialization :) Quote Share this post Link to post Share on other sites
mkhzaleh 136 Report post Posted February 25, 2019 if won't use serialization , this @Angelix function but will allow u to adjust how many characters can join , ChaosArgentMAC = ChaosArgentMAC or {} function check_can_enter_halloween( role, copy_mgr ) ----------Player characters check inside the maze------ local PlayerMac = tostring(GetAccountMAC(role)) local limit = 2 if ChaosArgentMAC[PlayerMac] == limit then Notice("you can't enter") return 0 end ------------- return 1 end function after_enter_halloween(role, map_copy) local PlayerMac = tostring(GetAccountMAC(role)) if ChaosArgentMAC[PlayerMac] == nil then ChaosArgentMAC[PlayerMac] = 0 end ChaosArgentMAC[PlayerMac] = ChaosArgentMAC[PlayerMac] + 1 Notice(""..ChaosArgentMAC[PlayerMac].."") end function before_leave_halloween(role) local PlayerMac = tostring(GetAccountMAC(role)) if ChaosArgentMAC[PlayerMac] == nil then ChaosArgentMAC[PlayerMac] = 0 end ChaosArgentMAC[PlayerMac] = ChaosArgentMAC[PlayerMac] - 1 Notice(""..ChaosArgentMAC[PlayerMac].."") end function map_copy_close_halloween(MapCopy) ChaosArgentMAC = {} end Quote Share this post Link to post Share on other sites
Angelix 381 Report post Posted February 26, 2019 There you go since I saw you added 'tostring'. ChaosArgentMac = ChaosArgentMac or {} ChaosArgentMacLimit = 1 function check_can_enter_garner2(Player, CopyMGR) ... local PlayerMac = tostring(GetAccountMAC(Player)) ChaosArgentMac[PlayerMac] = ChaosArgentMac[PlayerMac] or 0 if ChaosArgentMac[PlayerMac] >= ChaosArgentMacLimit then SystemNotice(Player, "You cannot enter since you already have "..ChaosArgentMacLimit.." accounts inside.") return 0 end end function after_enter_garner2(Player, MapCopy) ... local PlayerMac = tostring(GetAccountMAC(Player)) ChaosArgentMac[PlayerMac] = ChaosArgentMac[PlayerMac] + 1 end function before_leave_garner2(Player) ... local PlayerMac = tostring(GetAccountMAC(Player)) ChaosArgentMac[PlayerMac] = ChaosArgentMac[PlayerMac] - 1 end function map_copy_close_garner2(MapCopy) ... ChaosArgentMac = {} end Quote Share this post Link to post Share on other sites
Destiny 0 Report post Posted April 30, 2022 On 2/25/2019 at 9:06 PM, Angelix said: There you go since I saw you added 'tostring'. ChaosArgentMac = ChaosArgentMac or {} ChaosArgentMacLimit = 1 function check_can_enter_garner2(Player, CopyMGR) ... local PlayerMac = tostring(GetAccountMAC(Player)) ChaosArgentMac[PlayerMac] = ChaosArgentMac[PlayerMac] or 0 if ChaosArgentMac[PlayerMac] >= ChaosArgentMacLimit then SystemNotice(Player, "You cannot enter since you already have "..ChaosArgentMacLimit.." accounts inside.") return 0 end end function after_enter_garner2(Player, MapCopy) ... local PlayerMac = tostring(GetAccountMAC(Player)) ChaosArgentMac[PlayerMac] = ChaosArgentMac[PlayerMac] + 1 end function before_leave_garner2(Player) ... local PlayerMac = tostring(GetAccountMAC(Player)) ChaosArgentMac[PlayerMac] = ChaosArgentMac[PlayerMac] - 1 end function map_copy_close_garner2(MapCopy) ... ChaosArgentMac = {} end Hmm can anyone guide or help? Willing to pay Quote Share this post Link to post Share on other sites
Angelix 381 Report post Posted April 30, 2022 7 minutes ago, Destiny said: Hmm can anyone guide or help? Willing to pay What do you need help with? Quote Share this post Link to post Share on other sites
Destiny 0 Report post Posted May 1, 2022 13 hours ago, Angelix said: What do you need help with? Please drop your Discord I wanna talk those things privately. Thanks Quote Share this post Link to post Share on other sites
eatsangels 2 Report post Posted August 14, 2022 On 2/25/2019 at 4:19 AM, mkhzaleh said: he can use this way too , but its may be heavily loading idk function UPOGCin(Player)--player enter local pKey = "pKey" local File = GetResPath("../PlayerData/GoddessCollisio/"..pKey..".db") local macplayer = GetAccountMAC(Player) if UPOGCmap == nil then if file_exists(File) == false then UPOGCmap = {} table.save(UPOGCmap, File) else UPOGCmap = table.load(File) end end if UPOGCmap[macplayer] == nil then UPOGCmap[macplayer] = {Limit = 0} table.save(UPOGCmap, File) end if UPOGCmap[macplayer].Limit > 2 then UPOGCmap[macplayer].Limit = 2 end UPOGCmap[macplayer].Limit = UPOGCmap[macplayer].Limit + 1 table.save(UPOGCmap, File) end function UPOGCout(Player)--player leave local pKey = "pKey" local File = GetResPath("../PlayerData/GoddessCollisio/"..pKey..".db") local macplayer = GetAccountMAC(Player) if UPOGCmap == nil then if file_exists(File) == false then UPOGCmap = {} table.save(UPOGCmap, File) else UPOGCmap = table.load(File) end end if UPOGCmap[macplayer] == nil then UPOGCmap[macplayer] = {Limit = 0} table.save(UPOGCmap, File) end if UPOGCmap[macplayer].Limit < 0 then UPOGCmap[macplayer].Limit = 0 end UPOGCmap[macplayer].Limit = UPOGCmap[macplayer].Limit - 1 table.save(UPOGCmap, File) end function after_enter_UPOGC(role, map_copy) UPOGCin(role) end before_leave_UPOGC(role) UPOGCout(role) end function check_can_enter_UPOGC(role, copy_mgr) local UPOGC_charlimits = 2 -- mean player can join with 2 characters only -- local pKey = "pKey" local File = GetResPath("../PlayerData/GoddessCollisio/"..pKey..".db") local macplayer = GetAccountMAC(role) if UPOGCmap == nil then if file_exists(File) == false then UPOGCmap = {} table.save(UPOGCmap, File) else UPOGCmap = table.load(File) end end if UPOGCmap[macplayer] == nil then UPOGCmap[macplayer] = {Limit = 0} table.save(UPOGCmap, File) end if UPOGCmap[macplayer].Limit >= UPOGC_charlimits then BickerNotice(role,"You have 2 characters Inside") return 0 end end this one works fine , Could you tell me where you placed this function, to also put it on my server Quote Share this post Link to post Share on other sites
V3ct0r 2,143 Report post Posted August 15, 2022 21 hours ago, eatsangels said: Could you tell me where you placed this function, to also put it on my server Looks like this code is located in the file: GameServer\resource\UPOGC\ctrl.lua 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
eatsangels 2 Report post Posted August 15, 2022 57 minutes ago, V3ct0r said: Looks like this code is located in the file: GameServer\resource\UPOGC\ctrl.lua That folder is not inside my files. If I create the folder and create the .lua, will it work the same? Quote Share this post Link to post Share on other sites
V3ct0r 2,143 Report post Posted August 18, 2022 On 8/15/2022 at 3:04 PM, eatsangels said: That folder is not inside my files. If I create the folder and create the .lua, will it work the same? Instead of "UPOGC" use a map on which you want apply the script. Do not forget rename functions accordingly with your map name. 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
eatsangels 2 Report post Posted August 18, 2022 1 hour ago, V3ct0r said: Instead of "UPOGC" use a map on which you want apply the script. Do not forget rename functions accordingly with your map name. I tried to paste the script and change the name but it didn't work for me Quote Share this post Link to post Share on other sites
eatsangels 2 Report post Posted August 18, 2022 (edited) Just now, V3ct0r said: Instead of "UPOGC" use a map on which you want apply the script. Do not forget rename functions accordingly with your map name. put the function at the end of all and change the function name from function UPOGCin(Player)--player enter to garner2in(Player)--player enter and the map does not open. Could you tell me in which part is that the function goes. At the end, at the beginning, or should I remove one of the ones on the map. Edited August 18, 2022 by eatsangels Quote Share this post Link to post Share on other sites
eatsangels 2 Report post Posted August 19, 2022 On 8/18/2022 at 5:48 AM, V3ct0r said: Instead of "UPOGC" use a map on which you want apply the script. Do not forget rename functions accordingly with your map name. Could you tell me then in which part is that I should paste the script. If I want it to be for CA (Garner 2), what should I do? Quote Share this post Link to post Share on other sites
eatsangels 2 Report post Posted August 19, 2022 On 2/25/2019 at 11:06 PM, Angelix said: There you go since I saw you added 'tostring'. ChaosArgentMac = ChaosArgentMac or {} ChaosArgentMacLimit = 1 function check_can_enter_garner2(Player, CopyMGR) ... local PlayerMac = tostring(GetAccountMAC(Player)) ChaosArgentMac[PlayerMac] = ChaosArgentMac[PlayerMac] or 0 if ChaosArgentMac[PlayerMac] >= ChaosArgentMacLimit then SystemNotice(Player, "You cannot enter since you already have "..ChaosArgentMacLimit.." accounts inside.") return 0 end end function after_enter_garner2(Player, MapCopy) ... local PlayerMac = tostring(GetAccountMAC(Player)) ChaosArgentMac[PlayerMac] = ChaosArgentMac[PlayerMac] + 1 end function before_leave_garner2(Player) ... local PlayerMac = tostring(GetAccountMAC(Player)) ChaosArgentMac[PlayerMac] = ChaosArgentMac[PlayerMac] - 1 end function map_copy_close_garner2(MapCopy) ... ChaosArgentMac = {} end Could you help me please?. I want to implement this script on some of my maps and I haven't been able to get it to work. Some help please. Quote Share this post Link to post Share on other sites
V3ct0r 2,143 Report post Posted August 21, 2022 Hello @eatsangels, I don't know how this script work and what dependencies are needed for it to work. And honestly, I don't want to understand it. I can only give some general advice. Also, maybe it's not a good solution to restrict map entry by MAC address? The MAC address can be easily spoofed. IMHO, it is better to take some valuable resource from players (gold, reputation points, items). 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
StaffEN 5 Report post Posted May 19 On 2/25/2019 at 3:19 AM, mkhzaleh said: if won't use serialization , this @Angelix function but will allow u to adjust how many characters can join , ChaosArgentMAC = ChaosArgentMAC or {} function check_can_enter_halloween( role, copy_mgr ) ----------Player characters check inside the maze------ local PlayerMac = tostring(GetAccountMAC(role)) local limit = 2 if ChaosArgentMAC[PlayerMac] == limit then Notice("you can't enter") return 0 end ------------- return 1 end function after_enter_halloween(role, map_copy) local PlayerMac = tostring(GetAccountMAC(role)) if ChaosArgentMAC[PlayerMac] == nil then ChaosArgentMAC[PlayerMac] = 0 end ChaosArgentMAC[PlayerMac] = ChaosArgentMAC[PlayerMac] + 1 Notice(""..ChaosArgentMAC[PlayerMac].."") end function before_leave_halloween(role) local PlayerMac = tostring(GetAccountMAC(role)) if ChaosArgentMAC[PlayerMac] == nil then ChaosArgentMAC[PlayerMac] = 0 end ChaosArgentMAC[PlayerMac] = ChaosArgentMAC[PlayerMac] - 1 Notice(""..ChaosArgentMAC[PlayerMac].."") end function map_copy_close_halloween(MapCopy) ChaosArgentMAC = {} end I tested this and didnt work for me, someone can share the garner2 folder to compare this?, or need some other function at functions.lua?, can someone help me? thanks to all Quote Share this post Link to post Share on other sites