Jump to content

Recommended Posts

Posted (edited)

if (player.getUptime() >= val*60*60*1000)

 

val stands for hours.

 

and for reseting the time, go at Logout.java and add this line:

 

player.setUptime(0);

 

By the way, dunno what project are you using. The codes that I wrote you are based on l2jfrozen methods.

Edited by Devlin
Posted

if (player.getUptime() >= val*60*60*1000)

 

val stands for hours.

 

and for reseting the time, go at Logout.java and add this line:

 

player.setUptime(0);

 

By the way, dunno what project are you using. The codes that I wrote you are based on l2jfrozen methods.

 

Are you check my PM?

  • 2 weeks later...
Guest Elfocrash
Posted

if (player.getUptime() >= val*60*60*1000)

 

val stands for hours.

 

and for reseting the time, go at Logout.java and add this line:

 

player.setUptime(0);

 

By the way, dunno what project are you using. The codes that I wrote you are based on l2jfrozen methods.

This wont work on any kind of project ever unless you check in as a task.

Also the time of uptime is automaticaly reset on logout.

Posted

This wont work on any kind of project ever unless you check in as a task.

Also the time of uptime is automaticaly reset on logout.

For sure it needs a task.

 

About the reset, I didn't know :P

Posted (edited)

A simple task with a counter linked to L2PcInstance can do the trick. Inside the run section you ++ the counter and make checks regarding it.

 

An exemple for monster derby track which I'm currently recoding for aCis, making checks every seconds to call events :

 

Called by

ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Announcement(), 0, 1000);

And running

	class Announcement implements Runnable
	{
		public Announcement()
		{
		}
		
		@Override
		public void run()
		{
			if (_finalCountdown >= 1200)
				_finalCountdown = 0;
			
			switch (_finalCountdown)
			{
				case 0:
					makeAnnouncement(SystemMessageId.MONSRACE_TICKETS_AVAILABLE_FOR_S1_RACE);
					break;
				
				case 30: // 30 sec
				case 60: // 1 min
					...
				
				case 1080: // 18 min
					makeAnnouncement(SystemMessageId.MONSRACE_RACE_START);
					break;
			}
			_finalCountdown += 1;
		}
	}

As you can see on my exemple, it runs the task every second, increasing _finalCountdown value and checking if that variable reached a particular number.

			if (_finalCountdown >= 1200)
				_finalCountdown = 0;

exists to make a cycle of 20min (reset to 0 when it happens).

 

Instead of 1000 (one second), you put 60000 (one minute) for scheduleGeneralAtFixedRate timer and then you can reward for case 30, 60, 120, etc (30min, 1hour, 2hours,..).

Edited by Tryskell
Guest
This topic is now closed to further replies.


  • Posts

    • WIPE ! NEW SEASON GRAND OPENING FROM TODAY ! - 23/01/2026, FRIDAY, 20:00 +3 GMT !
    • https://vpslab.cloud/ Premium DDoS Protection now included with every server.
    • # Changelog - Public Updates   This changelog tracks user-facing updates and improvements to Top.MaxCheaters.com.   ---   ## [1.2.0] - 2026-01-XX   ### ⚡ Performance Improvements - **Faster Page Loads**: Implemented intelligent caching system that makes pages load significantly faster - **My Servers Page**: Now loads instantly when revisiting (no more loading delays) - **Main Page**: Server listings and filters now load faster on repeat visits - **Premium Ads**: Pricing information loads instantly - **Overall Performance**: Site now loads 60-80% faster with reduced server load   ### 🔄 Improvements - Pages now remember recent data, reducing wait times when navigating - Automatic cache refresh ensures you always see up-to-date information - Better user experience with instant page loads on repeat visits   ---   ## [1.1.1] - 2026-01-XX   ### 🐛 Bug Fixes - **VIP Server Filter**: Fixed "VIP L2 Servers" filter to correctly show all premium tier servers (VIP, Gold VIP, and Pinned) - **Ad Pricing Display**: Fixed ad pricing on Premium Ads page to automatically update when changed in admin panel   ### 🔄 Improvements - Ad pricing now syncs automatically across all pages - More accurate server filtering by tier   ---   ## [1.1.0] - 2026-01-XX   ### ✨ New Features - **Complete Chronicle List**: All chronicle options are now available in server forms and filters, including the latest Lineage 2 chronicles - **Improved Chronicle Display**: Server rows now show cleaner, shorter chronicle names for better readability   ### 🐛 Bug Fixes - **Chronicle Filter**: Fixed issue where "Infinite Odyssey" chronicle filter was not working correctly - **Missing Chronicles**: Fixed missing chronicle options in server creation and editing forms   ### 🔄 Improvements - Chronicle filters and dropdowns now stay in sync with the latest available chronicles - Better chronicle name formatting in server listings for improved visual clarity   ---   ## [1.0.0] - Initial Release   ### Features - 🎮 Server listings with multiple tiers (Normal, VIP, Gold VIP, Pinned) - 📊 Click tracking and server statistics - 🌍 Multi-language support (English, Spanish, Portuguese, Greek, Russian) - 💳 Payment system for premium server features - 🔐 Secure authentication system - 👑 Admin panel for server management - 📱 Fully responsive design for all devices - 🔍 Advanced filtering system (by chronicle, rate, server type, date) - 📅 Server opening date tracking - 🎯 Two viewing modes: By Date and By Votes (coming soon for all users)   ---   ## About This Changelog   This changelog focuses on updates that directly impact the user experience. Internal development changes and technical improvements are not included here.   For questions or feedback, please contact support.v
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..