Syfax 2 Report post Posted April 23, 2016 (edited) Hi! Please help me i need function for when relog inside Chaos argent players wont be able to join or enter the portal for 3 minutes like relog punishment? and function for other maps too please? i tried search on search function but no relog punishment release. please help who have this Edited April 24, 2016 by Syfax Quote Share this post Link to post Share on other sites
Syfax 2 Report post Posted April 24, 2016 BUMP pls Quote Share this post Link to post Share on other sites
V3ct0r 2,121 Report post Posted April 24, 2016 You can make an array in varible.lua Chaos = {} and add to it values when character join Chaos: Chaos[character ID] = join time In function check_can_enter_map (ctrl.lua) you can check character's last join time. if it equals to nil or larger than current time then character can pass portal 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
Sultan 68 Report post Posted April 25, 2016 (edited) Put inside variable.lua: ChaosArgentRelog = {} Go to CTRL.lua for chaos argent which is: garner2 and find this: function before_leave_garner2( role ) Add inside this function: if(Hp(role) > 0)then local name = GetChaDefaultName(role) local punishmentTime = 180 -- 3 mins ChaosArgentRelog[name] = os.time() + punishmentTime end Inside entry.lua at function (check_can_enter_garner2) add this before 'return 1': local name = GetChaDefaultName(role) if(ChaosArgentRelog[name] ~= nil)then local relogRemainTime = ChaosArgentRelog[name] - os.time() if(relogRemainTime > 0)then BickerNotice(role,'You relogged inside Chaos Argent! You will be able to enter again in next ('..relogRemainTime..' secs)..') return 0 end end -- Here it should be inside function normally, Remember it must be before return 1! ^ return 1 It should work perfectly, good luck =D Edited April 25, 2016 by Sultan 3 Quote Share this post Link to post Share on other sites
Jones 36 Report post Posted April 25, 2016 (edited) @Sultan can you tell me what makes it able to distingush between a player dead leaving and a person relogging? Thanks Edited April 25, 2016 by Jones Quote Share this post Link to post Share on other sites
Billy 164 Report post Posted April 25, 2016 @Jones when a player kills a player, set the dead players entry time to nill. Quote Share this post Link to post Share on other sites
Jones 36 Report post Posted April 25, 2016 43 minutes ago, 7n6 said: @Jones when a player kills a player, set the dead players entry time to nill. i dont see that in the script above, do I have to add it in if i wanted to implement this? Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted April 25, 2016 1 hour ago, 7n6 said: @Jones when a player kills a player, set the dead players entry time to nill. I dont think that will work. because player_kill_player happens before 9 hours ago, Sultan said: function before_leave_garner2( role ) Add inside this function: local name = GetChaDefaultName(role) local punishmentTime = 180 -- 3 mins ChaosArgentRelog[name] = os.time() + punishmentTime I would suggest in before_leave_garner2 that you check if Hp(role) is greater than 0. 1 hour ago, Jones said: @Sultan can you tell me what makes it able to distingush between a player dead leaving and a person relogging? Thanks As explained above, you can check their HP. If they are dead already, then it should not be considered a relog. Another point to make, I think you can implement a better relog-punishment by using ChaHasTarget or something like it. Because... If you have full HP or half HP, but decide to relog for buffs, you get the punishment (which is bad, because you werent relogging from getting killed) but If you have full HP or half HP, decide to relog and no one has you as a target, you wont get a punishment (which is good). 1 Quote Share this post Link to post Share on other sites
Sultan 68 Report post Posted April 25, 2016 7 minutes ago, xtc said: I dont think that will work. because player_kill_player happens before I would suggest in before_leave_garner2 that you check if Hp(role) is greater than 0. As explained above, you can check their HP. If they are dead already, then it should not be considered a relog. Another point to make, I think you can implement a better relog-punishment by using ChaHasTarget or something like it. Because... If you have full HP or half HP, but decide to relog for buffs, you get the punishment (which is bad, because you werent relogging from getting killed) but If you have full HP or half HP, decide to relog and no one has you as a target, you wont get a punishment (which is good). Yes my bad.. I forgot to add it Quote Share this post Link to post Share on other sites
Blanquitoh 50 Report post Posted April 25, 2016 IMO re-logging is re-logging it doesn't matter if u are going for buffs... Well am talking for a server with real PK with Clerics on the pk map otherwise u got a point xP. Quote Share this post Link to post Share on other sites