TonyCisseroni Posted February 27, 2020 Share Posted February 27, 2020 (edited) I have added the attack and mug modules in GL2... What is the best way to prevent a user from repeating it over and over again? If I mug someone, I can mug them again and again until they are broke. How can I stop this and add a delay of at least 24 hours before I can mug that player again? I don't want to prevent the user from mugging anyone for 24 hours, just from mugging the same player again in a 24 hour period. Any suggestions? UPDATE: I found a solution and I don't think I can delete my post here. The solution I came up with was to use a timestamp in the db and add a day to it. Then I check if the current time is greater than the timestamp in the db. If it is, they can do it again. Edited February 27, 2020 by TonyCisseroni Quote Link to comment Share on other sites More sharing options...
Curt Posted February 28, 2020 Share Posted February 28, 2020 That is a perfect solution 😉 Good job. 1 Quote Link to comment Share on other sites More sharing options...
TonyCisseroni Posted February 28, 2020 Author Share Posted February 28, 2020 (edited) 24 minutes ago, Curt said: That is a perfect solution 😉 Good job. Thank you! Now I need to look into the regular timer function for crimes and theft. That way they can't mug everyone in the game all at once 😁 Here is my code to add one day to the current time for a timestamp in the db: $muggedtime = strtotime('+1 day', $time); Edited February 28, 2020 by TonyCisseroni Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted February 28, 2020 Share Posted February 28, 2020 (edited) What you can do is store each mugging into a table and determine what a decent number of muggings in "x" amount of time would be like 3/hr or whatever. I created a mugging module for NWE and used this exact same approach I looked at the timers GL offers and didn’t see anything that may help you unless there was some sort of data field that you can serialize or whatever to extract that information out but I think it only returns a timestamp Edited February 28, 2020 by KyleMassacre 1 Quote Link to comment Share on other sites More sharing options...
Veramys Posted March 1, 2020 Share Posted March 1, 2020 Just out of curiosity why would you want to stop it? In all my years of text based games one constant was that you needed to watch leaving money out or you would get robbed. Part of strategic gameplay is making sure not to leave stuff on the markets and then log out. Limiting people to mugging player a once every 24 hours is really limiting gameplay. 3 Quote Link to comment Share on other sites More sharing options...
TonyCisseroni Posted March 2, 2020 Author Share Posted March 2, 2020 14 hours ago, Veramis said: Just out of curiosity why would you want to stop it? In all my years of text based games one constant was that you needed to watch leaving money out or you would get robbed. Part of strategic gameplay is making sure not to leave stuff on the markets and then log out. Limiting people to mugging player a once every 24 hours is really limiting gameplay. I'm not limiting them to mugging every 24 hours, I'm limiting them from mugging the same player over and over without restriction. Quote Link to comment Share on other sites More sharing options...
Veramys Posted March 2, 2020 Share Posted March 2, 2020 9 hours ago, TonyCisseroni said: I'm not limiting them to mugging every 24 hours, I'm limiting them from mugging the same player over and over without restriction. I know, I still don't see the point in restricting it. Limiting gameplay because one player makes a mistake and leaves money out makes no sense. Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted March 2, 2020 Share Posted March 2, 2020 1 hour ago, Veramis said: I know, I still don't see the point in restricting it. Limiting gameplay because one player makes a mistake and leaves money out makes no sense. Could be seen as harassment once it hits a certain point. As a preventative measure, I don't see x-per-time-limiting same-player hits as a bad idea - as long as it's not too restrictive. Quote Link to comment Share on other sites More sharing options...
Dayo Posted March 2, 2020 Share Posted March 2, 2020 You could do it so it increments i.e. 5 mins, 10 mins, 15 mins, 20 mins etc ... 1 Quote Link to comment Share on other sites More sharing options...
Veramys Posted March 3, 2020 Share Posted March 3, 2020 9 hours ago, Magictallguy said: Could be seen as harassment once it hits a certain point. As a preventative measure, I don't see x-per-time-limiting same-player hits as a bad idea - as long as it's not too restrictive. True, usually games have clear guidelines for harassment, I myself have used in the past the rule that offline hits don't count towards harassment. Harassment to me is something that impedes gameplay, with the player being at fault for leaving items and whatever else on the market, I don't see it as harassment so much as a lesson learned. Now if those mugs all happened online then it'd be a little different. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.