Jump to content
  • 0

[Help] Screen Message on TvT


Question

Posted

Hi people, i need some help here.

I want to change the systemMessage who tells you how much time last on the TvT to finish for a screenMessage.

So here is the code:

 

TvTEvent.sysMsgToAllParticipants("TvT Event: " + (time / 60) + " minute(s) until the event is finished!");

 

I must change to:

 

TvTEvent.scrMsgToAllParticipants("TvT Event: " + (time / 60) + " minute(s) until the event is finished!");

 

But if i put scr the code is worng :S

So what i have to do?

3 answers to this question

Recommended Posts

  • 0
Posted

Such method doesn't exist :). In order to make it working like that, add this method in TvTEvent, around where is the actual method sysMsgToAllParticipants( :

 

/**
 * Send a ShowScreenMessage to all participated players<br>
 * 1. Send the message to all players of team number one<br>
 * 2. Send the message to all players of team number two<br><br>
 *
 * @param message as String<br>
 */
public static void scrMsgToAllParticipants(String message, int time)
{
	for (L2PcInstance playerInstance : _teams[0].getParticipatedPlayers().values())
	{
		if (playerInstance != null)
			playerInstance.sendPacket(new ExShowScreenMessage(message, time));
	}

	for (L2PcInstance playerInstance : _teams[1].getParticipatedPlayers().values())
	{
		if (playerInstance != null)
			playerInstance.sendPacket(new ExShowScreenMessage(message, time));
	}
}:

 

Use of this method is something like : TvTEvent.scrMsgToAllParticipants((time / 60) + " minute(s) until TvT event's end !", 20000);, where 20000 = 20 seconds.

 


 

PS : you have to import ShowScreenMessage serverpacket.

  • 0
Posted

Such method doesn't exist :). In order to make it working like that, add this method in TvTEvent, around where is the actual method sysMsgToAllParticipants( :

 

/**
 * Send a ShowScreenMessage to all participated players<br>
 * 1. Send the message to all players of team number one<br>
 * 2. Send the message to all players of team number two<br><br>
 *
 * @param message as String<br>
 */
public static void scrMsgToAllParticipants(String message, int time)
{
	for (L2PcInstance playerInstance : _teams[0].getParticipatedPlayers().values())
	{
		if (playerInstance != null)
			playerInstance.sendPacket(new ExShowScreenMessage(message, time));
	}

	for (L2PcInstance playerInstance : _teams[1].getParticipatedPlayers().values())
	{
		if (playerInstance != null)
			playerInstance.sendPacket(new ExShowScreenMessage(message, time));
	}
}:

 

Use of this method is something like : TvTEvent.scrMsgToAllParticipants((time / 60) + " minute(s) until TvT event's end !", 20000);, where 20000 = 20 seconds.

 


 

PS : you have to import ShowScreenMessage serverpacket.

 

You are the best men, you have my respect.

 


 

Edit:

An image of the code working:

 

Shot00060.jpg

 

Thanx again Tryskell.

Topic Solved. Close it please :)

Guest
This topic is now closed to further replies.


  • Posts

    • i'm doing the same, but 'training with olympiad videos.
    • Hi, I’m interested in purchasing a C4 (Chronicle 4) server pack or source code, preferably something that has already been tested and run on a live server. I’m looking for a stable, well-tested project rather than a fresh/unproven build. If you have something available for sale, please send me some details, including the price and what is included.
    • ⚡ High-performance AI tools ready to boost your productivity. Instant delivery on ChatGPT Plus, Claude, and Cursor!
    • To give your server the maximum launch exposure, we built L2Calendar as a calendar-first listing. We are pushing it hard with constant SEO, a 4-language Blog/Vlog, and a Public API to bring real players to your listing — our primary goal is to become the most complete and best-known L2 calendar on the internet.   FREE Server Adding — Auto-Approved, add your server in just 2 minutes at l2calendar.com/addnews. Simply add our button to your website and your listing is auto-approved instantly. We give you the code, you paste it, done. VIP Auto-Approved Instantly No button required. Any VIP listing is approved automatically upon submission. 🎁 All 4 VIP tiers are currently FREE (limited stock), so you can get top placement completely free at l2calendar.com/addnews_vip 4 VIP Tiers — Fully Automated Choose Bronze, Silver, Gold, or Gold+, all pinned above free servers. Select the number of days and your VIP goes live instantly. Manage everything yourself using your Unique ID (xxx-xxx-xxx-xxx) at l2calendar.com/extend-vip — extend or upgrade anytime. A 20% discount will be available when paid tiers return.  VIP4 Announcer + LIVE Countdown Timer, only VIP Gold+ (VIP4) gets the animated homepage announcer with a live ticking countdown (e.g. “Starts in 02:14:33”). It gives upcoming launches extra visibility and creates real hype before opening. EXCLUSIVE: Add to Calendar — Google / Outlook / AppleEvery server card includes an Add to Calendar option. Players can add your opening in one click to Google Calendar, Outlook, or Apple Calendar and receive a native notification when your server starts. More day-one logins, fewer missed launches. Powerful Discovery, players can discover servers by 15 Chronicles (Interlude to Essence), 5 Rate Types (Low / Craft / PvP / GvE / PTS), 12 Feature Labels, and Calendar Date (Today / Tomorrow / Next 10 Days / Past 10 Days + date picker).   Our Website: https://l2calendar.com Collaboration Contact: admin@l2calendar.com
  • 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..